newbie light question

I drawn my scene with a grid (white lines) and a square with a texture; I’m trying to change light position and I can see the difference only on the grid; why this? why I can’t change difference light in my textured sqaure; thanks

const float spec[4]={.4f,.4f,.4f,1};
const float shin = 1;
glMaterialfv(GL_FRONT_AND_BACK,GL_SPECULAR ,spec);

GLfloat light_position[4] = {0,4,2,0};
glLightfv(GL_LIGHT0, GL_POSITION, light_position);
glLightfv(GL_LIGHT0, GL_DIFFUSE, white_light);
glLightfv(GL_LIGHT0, GL_AMBIENT,light_ambient);
glLightfv(GL_LIGHT0, GL_AMBIENT,light_diffuse);

If u want to change light position u must update your light position every frame. for example:

void Draw()

glLightfv(GL_LIGHT1, GL_POSITION, LightPosition);

… // Some Draw code

this is ok; in fact I can see effect of light changing, but only on white grid! I don’t see effect on sqaure textured.Why this?

What texture function you use on the textured grid? If it is GL_REPLACE, you will need to use GL_MODULATE instead.

It’s seems don’t change; change luminacne of some objects drawn with glVertex() and glColor but not texture…


maybe I didin’t to be clear; The grid are many lines white; the textures are on a square; then there’s an arrow ( drawn with gevertex,glcolor…). I can see effect of change light position on the grid, on the arrow, but not on the texture ( i can change light pos very much, but the square textures appear in the same way). Is it normal?

post a Screenshot

here is a site that can host

and BTW do you have your normals loaded?