Alpha blending... stupid question...

Started by
6 comments, last by smitty1276 22 years, 8 months ago
If I want to draw a textured-quad that is translucent, how do I do it. Do I set the alpha value for the texture''s pixels, do I set the alpha value for the quad''s color, or do I do both?
Advertisement
Set the alpha value through the textures quad vertices and call glTexEnvi(GL_TEXTURE_ENV, GL_TEX_ENV_MODE, GL_MODULATE);
----------------------------www.physicsforums.comwww.opengl.org
What do you mean the texture''s quad vertices? You mean the vertices of the quad which I am going to texture?
Yeah thats what I mean sorry for the ambiguity. The modulate env parameter will blend the color of the quad (including the alpha) with that of the texture. Have you tried it yet?
----------------------------www.physicsforums.comwww.opengl.org
this might be of interest (i uploaded an app that explains opengl blending yesterday to my site)

http://members.xoom.com/myBollux
Cool... thanks guys.
OK, I tried it out on the GLAppWiz app with the cube rotating on 3 axes. It works fine, EXCEPT occasionally one of the sides will rotate toward the front and will appear solid. Then it may rotate back around and be blended properly the next pass.

What could be causing that?

Is it because of the order in which the faces are rendered and the depth of those faces?


Edited by - smitty1276 on July 9, 2001 12:42:23 AM
You have to disable depth testing
glDisable(GL_DEPTH_TEST);
Justin Olson

This topic is closed to new replies.

Advertisement