Texture and light at the same time
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.
you need to set the tex-coords using glTexCoord2f, and the normal using glNormal3f for each vertex so that it would work
use
glBindTexture(GL_TEXTURE_2D,&YourTexture);
glTexEnv(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_MODULATE);
This will fix will problem i hope
glBindTexture(GL_TEXTURE_2D,&YourTexture);
glTexEnv(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_MODULATE);
This will fix will problem i hope
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.
Regards,
Mathematix.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement