Archived

This topic is now archived and is closed to further replies.

AIRmichael

Texture and light at the same time

Recommended Posts

AIRmichael    136
Hey, I cant use light and have a texture at the same time. Does any 1 know how to fix this? I enabled the lighting. And it only works when there is no texture on it. I am just useing standard lighting atm. Useing glLightAmbient etc. Michael L.

Share this post


Link to post
Share on other sites
danz    122
you need to set the tex-coords using glTexCoord2f, and the normal using glNormal3f for each vertex so that it would work

Share this post


Link to post
Share on other sites
browny    139
use
glBindTexture(GL_TEXTURE_2D,&YourTexture);
glTexEnv(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_MODULATE);

This will fix will problem i hope

Share this post


Link to post
Share on other sites
Mathematix    259
I recently discovered a solution to this by accident, in creating my game. For instance, if using spheres have an inner sphere emitting light and have a second transparent sphere enclosing the emitting sphere, texture mapped. The texture map of the transparent sphere also inherets the tranparency.

Regards,
Mathematix.

Share this post


Link to post
Share on other sites