Sign in to follow this  

Using textures and plain colors separately?

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

Ok I'll make this quick so I can get to sleep. I have successfully added textures into my program to make a skybox. I had another separate object rendered in the middle that is untextured, it is only colored using glColor3f(). The problem is that when the textures are working the object shows up black. This seems like an easy fix to me but I searched everywhere for it and didn't find anything. Through commenting out some lines I found the guilty call to be glTexParameteri(). When these were eliminated the color came back (but the textures didn't work of course).

Share this post


Link to post
Share on other sites
Try calling glDisable(GL_TEXTURE_2D) before drawing the object (and reenabling it when drawing the skybox, of course).

Alternatively, you could just use glBindTexture(GL_TEXTURE_2D, NULL) before the object drawing routine.

When you skip glTexParameteri, no texture will be generated - so this is roughly equivalent to setting the texture to NULL (or at least I think so).

Cheers!

Share this post


Link to post
Share on other sites
Quote:
Original post by Johnny Sunshine
Alternatively, you could just use glBindTexture(GL_TEXTURE_2D, NULL) before the object drawing routine.

If you want to disable texturing, then you have to disable texturing, not bind another texture object.

Share this post


Link to post
Share on other sites

This topic is 3932 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this