Textured Polygons & Light effects?


Does somebody know how to get a polygon with texture and light effects? I ask because when I texture a polygon then no shade effects are applied to that polygon.

Thanks in advance for your help and greetings from Spain


  1. Make sure you’ve set up a light

  2. Make sure you’ve defined a material. To start with, try using white for the diffuse component, black for ambient and specular.

  3. Check your glTexEnvf mode. You want to multiply the texture colour by the lit base colour, so try GL_MODULATE.


I know that the light and material properties are working fine, because without the texture is works. Using GL_MODULATE doesn’t solve my problem, because I get the color of the polygon modulated with the luminosity of the texture. Therefore I get the color of the polygon with the pattern of the texture, but not the texture with the light effect of the polygon :frowning:

Thanks for the hint


Then make the color of the polygons white. :stuck_out_tongue:

Yeah - if your light and material are both white, then GL_MODULATE should be doing the trick. (Assuming you have an RGB/RBGA texture.)

when you apply texture, the specular component must be done after the texture mapping.

So here is what you do.

set up your light the way you want it with specular = BLACK.

draw cube with texture map.

turn texture mapping on

set up your light again with specular component = something else than black, but all the other to black.

draw cube.

there is also an extension that permits you to do like normally. The card will do the specular component after the texture map.

I believe the name of the extension is ext_separate_specular are something like that I hope!

can’t wait for an opengl 1.2 implementation. The separation of specular color is a requirement, so no more extension for that!! woohoo!!


Thanks for the hint with the white color :slight_smile:

It looks more or less like I was looking for :wink: