Sign in to follow this  

I don't want TRANSPARENT POLYGONS!

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

Someone help me please! I'm using GL_LIGHTING and my polygons turn out to be transparent. I'm drawing a simple shelf of polygons, but you can see through the polygons forming the shelf. I don't like that. I want my polygons to be INtransparent These are my material settings: GLfloat brownMat[] = {0.63f, 0.31f, 0.18f, 1.0f}; GLfloat blackMat[] = {0.0f, 0.0f, 0.0f, 1.0f}; glMaterialfv(GL_FRONT, GL_AMBIENT, blackMat); glMaterialfv(GL_FRONT, GL_DIFFUSE, brownMat); glMaterialfv(GL_FRONT, GL_SPECULAR, blackMat); As you can see, the alpha values are all set to 1, so I'm supposed to expect nothing but a beautiful brown shelf. But I'm getting a shelf structure made of transparent polygons instead. It looks more like a shelf made of brown glass. So what's the problem here? How can I make the polygons INtransparent? Cheers Marvin

Share this post


Link to post
Share on other sites
I would say you should try disabling GL_BLEND (or the equivalent, I haven't used OpenGL in a while). You could also make sure that depth testing is enabled. Hope this helps.

Share this post


Link to post
Share on other sites
It's hard to tell what is wrong from your description. It could possibly be inverted normals, depth testing not enabled, or depth writing is disabled. Do you call glEnable(GL_BLEND) anywhere? Do you have color material enabled and then call glColor with a non 1.0 alpha value? Are you using textures? Do your textures contain an alpha channel? Post a screen shot. Post some more code as well if your project is small.

Share this post


Link to post
Share on other sites
The previous comment addresses the original question, but the word you're looking for is "opaque".

Share this post


Link to post
Share on other sites
turn off blending should fix the problem.

anywhere in yourcode or right before you draw your objects/data

GL_Disable(GL_BLEND);

Share this post


Link to post
Share on other sites

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