Strange if-else branching behavior in a fragment shader
- by Winged
In my fragment shader I have passed an uniform int uLightType variable, which indicates what type of light is in usage right now. The problem is that if-else branching does not work correctly - the fragment shader performs instructions in every if statement block.
if (uLightType == 1) { // Spotlight light type
vec3 depthTextureCoord =…