well i think this is similar to the || or && logical optimization in c++ or java.
if you have f.e. the expression (A && B) and you know that A is false, you also know that the whole expression can’t be true and so you have not to calculate B.
So it’s faster when you use the constant 0.0 but slower when you use a variable with the value 0.0 in it? That kind of makes sense because the variable may have changed value and the compiler hasn’t looked at what has happened to the value of the variable whereas it knows the constant will always be 0.0.
i thinks thats whats happening, even if uniform variables ARE constant, so its value shouldnt change, but as its after the compiler stage, it doesnt change anything
When compiling your shader, the compiler tries to optimize as much as possible. Later, when the shader gets used, such an optimization doesn´t take place anymore, and it is certainly impossible, because that would mean, the driver would have to recompile the shader, with known values, everytime you change your uniforms, etc.
So, later there actually takes a multiplication place, even with 0.0.