When we use a texture in a shader script (fragment shader) but it is empty,
it is important to remove it in the code or use condition" if" ( shader feature and if block) to check it is empty or not?
1 Like
An empty texture slot just means it uses a default texture. Usually a 1 pixel white texture unless you specify otherwise. If you don’t want to use the texture at all you’ll need to add a #pragma shader_feature, an #if block, and a [Toggle] property or custom editor to set the keyword to avoid it completely. Depending on the platform & shader, sampling a texture or two can almost be free in itself, so there’s not a lot of reason to do it. The one obvious case where it can be good to do it is with normal maps as there’s addition data and computation involved with their use that can be avoided if you don’t need them.
5 Likes