What does setting the GL color before doing a texture mapping operation do?
Posted
by quixoto
on Stack Overflow
See other posts from Stack Overflow
or by quixoto
Published on 2010-06-15T00:33:12Z
Indexed on
2010/06/15
0:42 UTC
Read the original article
Hit count: 269
I am looking at some sample code in a book that creates a jittered antialiasing effect by repeatedly rendering a scene (at different offsets) onto a offscreen texture, then using that texture to repeatedly draw a quad in the main view with some blend stuff set up.
To accumulate the color "correctly", the code is setting the color like so:
glColor4f(f, f, f, 1);
where f is 1.0/number_of_samples
, and then binding the offscreen texture and rendering it.
Since textures come with their own color and alpha data, what is the effect (mathematically and intuitively) that setting the overall "color" in advance achieves?
Thanks.
© Stack Overflow or respective owner