Skip to content Skip to sidebar Skip to footer

How Are `gltexenv`, `glcolor4x` And `glblendfunc` Related In Opengl Es 1.0?

I'm looking at SurfaceFlinger, i.e. the the code that is doing the composition in Android, and I have trouble understanding some of the OpenGL ES 1.0 calls as I've only programmed

Solution 1:

glTexEnv() sets the texture environment mode. GL_REPLACE tells the renderer to skip the current color (for example, from glColor4()) and instead tells the renderer to use your texture's colors for every corresponding pixel. If you, instead of GL_REPLACE, use GL_MODULATE, then your glColor4() call will be included together with the texture's colors when the renderer sets a pixel's color.

Your glColor4() call shouldn't be doing anything (when using GL_REPLACE) that can be seen on your object.

About your glBlendFunc() arguments:

GL_ONE is using the current color that comes from your incoming primitive, which we call source. GL_ONE_MINUS_SRC_ALPHA is multiplying the destination (which is the currently stored pixel in the frame buffer) by (1 - source alpha value).

Normally, when you're not using textures, you achieve a transparent effect from color primitives when the glColor4() contains an alpha value where 1 equals fully opaque and 0 fully transparent.

Post a Comment for "How Are `gltexenv`, `glcolor4x` And `glblendfunc` Related In Opengl Es 1.0?"