How lighting effects textured polys

problem! -

Ive got a cube made of triangles. This cube is texture mapped. I have a light in the scene.

When texture mapping is disabled I can see the effect of lighting on my cube. When I enable texture mapping the effects of lighting disapear.

I would like to make my lighting effect the textured polygons appearance as it does the non-textured object polygons, so basically can I set up vertex lighting to effect the textures or will i need to make some form of lightmap routines? Thanks in advance.

Dans

You need to make sure your texture environment is set to “GL_MODULATE” it’s prolly set to “GL_DECAL” or “GL_REPLACE” at the moment…

Paul.

Another thing is that specular lighting in not computed when using textures. You need a card that supports the GL_EXT_separate_specular_color extension or use the two-passes algorithm.

Regards.

Eric

Eric,

Specular lighting is computed when using textures. The problem is that all lighting components are summed before rasterization so that texturing modulates specular, diffuse and ambient components. GL_EXT_separate_specular_color just interpolates the specular component separately and sums it with the post-texture color.

Hope this helps -
Cass

Thanks for the info -

GL_MODULATE did the trick, after fiddling with some glMaterialfv settings (on the vertex structure) i did find no visual change in the textured polys. Ok now so if i set all RGB material values DIFF AMB and SPEC Lighting to 1.0, 1.0, 1.0 i get a massive frame rate hit. something in the realm of 40% mind you i have FRONT_AND_BACK lighting enabled.
Im not really asking questions here but more making a statement on the lighting effects. Feedback would be cool.

Dans