PDA

View Full Version : getting color inside fragment shader



JernejL
08-07-2006, 07:05 AM
I found that it is really important for my fragment shader to know the actual color of the fragment that it would be produced as if the fragment shader wasn't there, but there are only routines to get the texture color and some depth values, but i need to know THE color, because vertex colors are very important to me, and i need vertex colors to go into the fragment shader, how do i do to get them?

Komat
08-07-2006, 08:10 AM
If you are using the fixed function vertex processing, the color is stored in gl_Color and gl_SecondaryColor varyings. If you are using vertex shaders, your vertex shader is responsible for sending you the vertex color trought some varying.