GL Extentions and OpenGL lighting

Started by
1 comment, last by moetman 18 years, 7 months ago
I've managed to get GL Extensions happening thanks to GLEE, however when I use multitexturing I seem to lose the GL light shading for some reason. I have a terrain grid - I've calculated normals , however I suspect the textures are now in the GPU and not in openGL's pixel buffer so I'm not getting any light shading (??). If not that then maybe the way I'm using some tex parameters ?: glActiveTextureARB(GL_TEXTURE0_ARB); glBindTexture(GL_TEXTURE_2D, texture[0]); glEnable(GL_TEXTURE_2D); glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_EXT); glTexEnvf (GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, GL_REPLACE); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB8, terrain.width, terrain.width, 0, GL_RGB, GL_UNSIGNED_BYTE,terrain.data); Am I not able to use glTexParameteri() ?? If I do I get a lot of colour corruption , or the RGB is all screwed up . Regards
Advertisement
Quote:Original post by moetman
glTexEnvf (GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, GL_REPLACE);
That's the problem right there. GL_REPLACE uses only the color data from the texture. You need to use GL_MODULATE. I recommend reading the Texture Mapping chapter in the Red Book. If you don't own the Red Book, I suggest you pick yourself up a copy because that online version is for OpenGL 1.1 and is somewhat outdated.
Thanks Kalidor

This topic is closed to new replies.

Advertisement