View Full Version : Lighting&Texture Mapping
11-08-2004, 02: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, 05: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, 06: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.3 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.