PDA

View Full Version : Textured Polygons & Light effects?



07-03-2000, 11:16 PM
Hi,

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

Miguel

MikeC
07-04-2000, 06:19 AM
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.

07-04-2000, 12:27 PM
Hi,

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 :-(

Thanks for the hint

Miguel

DFrey
07-04-2000, 12:34 PM
Then make the color of the polygons white. :P

MikeC
07-04-2000, 12:36 PM
Yeah - if your light and material are both white, then GL_MODULATE should be doing the trick. (Assuming you have an RGB/RBGA texture.)

Gorg
07-04-2000, 01:10 PM
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!!

07-05-2000, 07:39 AM
Hi,

Thanks for the hint with the white color :-)

It looks more or less like I was looking for ;-)

Miguel