anopgl
11-02-2011, 09:14 AM
Hi
Please , could someone tell me what means adding ".xyz" to the vector returned by texture function?
I'm trying to understand some shader and why and when to do this. We assume that myTexture is a normal map passed as a texture to the pixel shader. Each pixel is a normal x,y,z stored as r,g,b.
vec3 normal;
normal = texture(myTexture, fragmentTexCoord).xyz;
Thanks in advance
Please , could someone tell me what means adding ".xyz" to the vector returned by texture function?
I'm trying to understand some shader and why and when to do this. We assume that myTexture is a normal map passed as a texture to the pixel shader. Each pixel is a normal x,y,z stored as r,g,b.
vec3 normal;
normal = texture(myTexture, fragmentTexCoord).xyz;
Thanks in advance