View Full Version : Additive blending with GLSL

08-03-2005, 01:30 AM
I want to do additive blending using GLSL. With fixed pipeline I would use:

glBlendFunc(GL_ONE, GL_ONE);

drawStuff()Is there any way to do this with GLSL? I tried using:

gl_FragColor += colorToAdd;doesn't produce correct results (I guess gl_FragColor doesn't contain the current framebuffer color). Is it possible to do this blending in a shader?

08-03-2005, 01:46 AM
Read the GLSL spec. GLSL does not replace the alpha blending part of the pipeline.
Your first approach should just work if the drawStuff is using GLSL or not.