opengl - What does setting the GL color before doing a texture mapping operation do? -


I'm looking at some sample code in a book that repeatedly creates an antelysing effect captured by a view (at different offsets) On an offscreen texture, then using that texture, dragging a tractor repeatedly in the main scene with some visual content set up.

The code is set to make the color such as "correctly":

  glColor4f (f, f, f, 1);  

Where f is 1.0 / number_of_samples , then binding to the offscreen texture and rendering it.

Since the textures come with their color and alpha data, what effect (mathematical and spontaneously) that sets the overall "color" in advance?

Thank you.

The default texture environment is GL_MODULATE, meaning that the top color (set with glColor) Is multiplied by. So, mathematically, it does:

  fragmentColor = texcolor / numberOfSamples (alpha = 1.0)  

Hope this Tells.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -