Jump to content
  • Advertisement
Sign in to follow this  
moetman

OpenGL GL Extentions and OpenGL lighting

This topic is 4810 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!