View Full Version : Lighting&Texture Mapping
11-08-2004, 03:23 AM
Hi, my name is Sam.I have a problem.
I dont know how to enable lighting using texture mapping at the same time.
I am using:
LIGHT0 have my own parameters.
My Object is fully lighted even if i dont enable LIGHT0!
I am looking for salvation.Please help!
p.s. I hope i can find the answer today.
I could be way wrong here, but I don't think you can do that. I think lighting does not affect textures. You probably need to apply a second texture that will act as a "light map".
11-08-2004, 06:16 AM
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
(but this should be set as default...).
This call controls how texture color and vertex color (lighting is evaluated per vertex and stored as color, which is then interpolated across the primitive) are blended.
11-08-2004, 07:43 AM
Light does affect textures.
I think the problem has to do with normal vectors.
You are probably not specifying any normal vectors
for the vertices. Typically, you give the texel
coordinates (TexCoord), then the normal vector
coordinates, then the vertex coordinates.
Also, you will need to:
Powered by vBulletin® Version 4.2.2 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.