View Full Version : doubling color values

07-22-2002, 11:23 AM
Is there a fast way to double the rgb values after i render all my stuff? I end up with all my rgb values between 0 and .5, and I want to scale them to between 0 and 1. I need to keep them between 0 and .5 while i draw all my polygons and stuff because I am using them to do some math, but I would like to scale the result to double the value afterwards. Any ideas?

07-22-2002, 11:42 AM
Once you've rendered your scene copy the back buffer into a texture using glCopyTexSubImage2D and then render it as a quad into the back buffer using glBlendFunc(GL_ONE,GL_ONE). This should be pretty fast.

Some cards don't support large textures. You should break the image up into tiles if you want it to work on all cards.

[This message has been edited by Adrian (edited 07-22-2002).]

07-22-2002, 12:13 PM
It's way easier (and faster) to just render a white fullscreen quad with glBlendFunc(GL_DST_COLOR,GL_SRC_COLOR).