Im trying to make a multi-light bump mapping application which uses texenv’s dot3 operation. I can get the bumpmapping working the a white light by using the following setup:
glClientActiveTextureARB(GL_TEXTURE0_ARB);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB);
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB_ARB, GL_TEXTURE);
glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, GL_REPLACE);
This code will draw white and black bumps given a normal map. I was wondering how i can change this so that i can color the bumps to a specific color. Thanks.
Chris
Where the primary color (glColorxx()) is the light color. Alternatively, you can use GL_CONSTANT_COLOR instead of GL_PRIMARY_COLOR and put the lights color int the TexEnv’s constant color.
Does anyone know how often you can set the TexEnv constant color? can it be done for every vertex (ie: use it like a secondary color?)
give us more information, what isn’t working? Its not coloring the light? do you have any blend modes set? is it dot3 but not colored? is it colored but not dot3?
I notice that you have: glClientActiveTextureARB for Unit 0 but glActiveTextureARB for Unit 1. Mayhaps this is an issue?
When I add the following code below the first, it appears that the glColor is applying to the actualy normal map, and the dot3 isnt even doing anything anymore:
So ive tried every combination of commands i could think of and still i cant assign a constant color to the bumpmap. The exact code im trying to change is: