Jump to content
  • Advertisement
Sign in to follow this  
Sabbas

Toggling texturing on/off depending on the object

This topic is 4490 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

Im writing an app for a school project where we're making a 3D terrain roamer. Everything is going well except 1 problem I'm having. I'm loading a heightmap from a file, and texturing with another file. Now I would like to add a simple polygon to resemble a simplistic ocean. Also failry simple. Im doing all my drawing in one simple display function. However I don't want to texture the ocean polygon in any way. I merely want it to be one large blue polygon. As I try to draw it after having drawn my terrain, the color of the polygon wont change. I assume I have to disable the texturing somehow. So my question is - how do I draw some objects in a scene textured, and others as simple primitives with a color specified by a glColor3f call?

Share this post


Link to post
Share on other sites
Advertisement
Use glDisable(GL_TEXTURE_2D) to disable texturing and only use vertex color, then use glEnable to turn it back on.

You should already have a glEnable call in there to do texturing in the first place... :)

Share this post


Link to post
Share on other sites
I did.
I found my problem. After disabling it, my textures were completley disabled.
So I thought it was a state variable controlling texturing in general and not for the individual object.
However I just saw that it was because I forgot enabling it again before drawing the terrain.

Anyway, it's working now - thanks for the help.

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!