Why oh why is there no shading?
Hi! I have a newbie opengl question....I have shading on non textured objects (the green box in the screen shot)
But once I texture it, the shading goes away... Im obviously missing some magical opengl command. :-/ *sigh*
(also note that the first object not being textured is another bug, but it just happens to help illustrate the problem :)
I did find a refernce to GL_LIGHT_MDOEL_COLOR_CONTROL, but that doesnt seem to be in my pyopengl library... hmm.
(log in to comment) Try this: Call this function in initialization code (may not be necessary; seems to be the default): glTexEnv(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_MODULATE) Then set the material properties of the to white, for example: glMaterialfv(GL_FRONT,GL_AMBIENT_AND_DIFFUSE,(1.0,1.0,1.0)) You may set specular color if you wish. The GL_LIGHT_MODE_COLOR_CONTROL thingie doesn't affect anything; it only changes a detail of specular component calculation. Hope this helps.
to:
and its all happy! I obviously missed that on my many trips through the opengl book. :)
Whoohoo! :) You totally rock! Thanks!
Comments
glTexEnvf(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_REPLACE)
glTexEnvf(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_MODULATE)
korg on 2006/03/26 12:23:
Well I solved the 'not loading the texture on the first object' problem. Silly typo.I give up on the shading. :)
(I wonder if its because im using software rendering?)