PDA

View Full Version : do I need to set values for uniform sampler2D vars?



g0l3m
12-19-2006, 03:40 AM
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.

Komat
12-19-2006, 03:48 AM
You need to set them. All uniforms within the shader are initially set to zero.

g0l3m
12-19-2006, 04:18 AM
lol...that would explain why it worked for the first one ;-)

Thx for the help Komat.