PDA

View Full Version : GLSL with glDrawPixels



ratta
07-28-2005, 07:05 AM
Hi, i'm trying to use a fragment shader with glDrawPixels, but i wasn't able to realize how to access the pixel data.
For instance i can draw a blue square putting:

gl_FragColor = vec4(0,0,1,0);

in the shader, but it is not what i wanted to do, as i would like to process the color that is being written :)
Thanks

yooyo
07-28-2005, 09:42 AM
Try this fragment shader:

void main(void)
{
gl_FragColor = gl_Color + vec4(0.2, 0.3, 0.4, 1.0);
}It works on NV hardware but seems it is not accelerated :(

yooyo