strange lighting ...not in original texture

Is there any reason why a texture copied using glCopyTexImage would automatically appear with what look like specular highlights, even though the original image to be copied had no such lighting? How can I override this lighting. It seems that when i say:

       GLfloat ambientLight[] = {1.0f, 1.0f, 1.0f, 1.0f};

and later,
glEnable(GL_LIGHTING);
glLightfv(GL_LIGHT1, GL_AMBIENT, ambientLight);
glEnable(GL_LIGHT1);

It still has no effect on the automatic lighting (that I’m trying to avoid). Any help would be appreciated! Thanks.

you try to copy texture without lighting effect, why don’t you disable lighting ???
assuming you have good reasons to do that, to avoid specular effects on the rendered entity, you can simply change the its material:
glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, black);
if you want to avoid also diffuse lighting add:
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, black);
of course black is:
float black[4]={0.0, 0.0, 0.0, 0.0};

you can also tune lighting parameters to disable specular effect but i think it is easier to change material.

just a question, in your post, your code talk about GL_LIGHT1. does your GL_LIGHT0 is enabled ??? if so, maybe your problem come from that.

automatic lighting ??? there is no automatic lighting in opengl.

Texture defualt environment is set to GL_MODULATE, primary colors (the lit geometry) modulate the texture color.
To disable lighting effects on textured geometry either disable lighting and set all colors to white (faster) or set texture environment to GL_DECAL (simpler).

Yoyo, when using alpha with lighting the alpha value is taken from the diffuse material. To avoid headaches black should be set as (0, 0, 0, 1) or you might get transparent geometry.

the alpha come from diffuse material, only diffuse material ???
so we can’t make an object transparent where specular hightlight is …

Thanks for all of your responses. Unfortunately, even if I go through and individually diable(GL_LIGHTi) (for i 0 to 7), the instant that I enable just one light source, say ambient, defined to be the brightest possible, such that

GLfloat ambient[] = {1,1,1,1};

the gray/bright splotches return! I’ve tried a few different things with my code, and i’m beginning to think that the weirdness has to do with the way i’m copying my Texture Image and then expecting it to show up mapped onto my rectangle. For instance, if my background consists of just white vertical lines, my copied image will appear to have a repeating pattern of say, two vertical white lines with the appropriate (and expected) brightness and then there will be say two gray ones, and then two even darker than those. If the Rectangle is small enough that the lines are forced to repeat themselves, then i’ll get a continous pattern of miscolored lines. Does this make sense and does it seem like something could be wrong with the way I set my viewport before and after I copy?

My code here says:

glViewport(0,0,256,256);
glCopyTexImage2D(GL_TEXTURE_2D,0, GL_RGBA8, 0, 0, 256, 256);
glViewport(x, y, 640, 480);

Thanks!

P.S…I did try calling
glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, black) and glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, black). And, I also tried setting the texture environment from GL_MODULATE to both GL_DECAL and GL_REPLACE. Neither of these seemed to help my problem.

Originally posted by yoyo:
the alpha come from diffuse material, only diffuse material ???
so we can’t make an object transparent where specular hightlight is …

You can. The alpha values at places where a specular highlight also gets the diffuse alpha (read the spec chapter 2.13.1 Lighting).

A screenshot (or even better an exe) would be helpful. I’m not sure what you’re describing is specular highlights.

that is not the main topic of the thread. i don’t try to obtain this effect. i just say that because it went on my mind.
maybe i don’t understand well the specification but if alpha is shared between diffuse and specular componments, you can’t make an object transparent ONLY where the specular spot is.
am i wrong ???