Do I need to set values for uniform sampler2D vars?

Hello all,

If my frag shader has something like

uniform sampled2D tex0;
uniform sampled2D tex1;
uniform sampled2D tex2;

do these automagicaly get initialised to

tex0 = 0;
tex1 = 1;
tex2 = 2;

?

Or do I need to set them from my application using all the glGetUnifromLocation and glUniform

cheers,
g.

You need to set them. All uniforms within the shader are initially set to zero.

lol…that would explain why it worked for the first one :wink:

Thx for the help Komat.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.