- Code: Select all
if(mColorOperation == ColorOperation.Add)
gl.glTexEnvf(GL10.GL_TEXTURE_ENV, GL10.GL_TEXTURE_ENV_MODE, GL10.GL_ADD);
else if(mColorOperation == ColorOperation.Texture)
gl.glTexEnvf(GL10.GL_TEXTURE_ENV, GL10.GL_TEXTURE_ENV_MODE, GL10.GL_REPLACE);
else // modulate
gl.glTexEnvf(GL10.GL_TEXTURE_ENV, GL10.GL_TEXTURE_ENV_MODE, GL10.GL_MODULATE);
That works great for color, but the problem is the vertex alpha value. I want the vertex alpha value to *always* use GL_MODULATE (or similar functionality) regardless of the color operation. Is there a way to specify that the vert alpha should be using a different value?
One work-around that I've found is to use the modulate logic even if my color opeation is Texture, but to pass 1's instead of the actual vert colors when creating my buffers. The problem is that puts some branching code in my code: I'm trying to sort by color operation and avoid having to branch per quad. Any advise would be greatly appreciated!