Force UV0 varying to be propagated into fragment shader

Hello!

I’m tinkering with shader chunk replacement, and would like to have a specific material for my project.

For that material I only need to have reflectionSphere texture, metalness set to 1, and a UV0 set from my vertex attributes.

However it seems to me that shader generator will skip pushing UV0 varying to fragment shader, if there is no diffuse or emissive texture assigned to material. I can do it for example with a fake transparent emissive texture not to affect my shading, but is there a better way to force shader compiler to include UV0 propagation?

Thanks!

1 Like

@mvaligursky may know more on this.

The usual trick is what you say, reference a texture on a material channel. And override the shader chunk to not actually use that texture.

1 Like

I tend to agree with @Leonidas’ suggestion, I’m not aware of something else.

1 Like