Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

JIMbond21

OGL alpha blending???

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

How could I make a textured quad that I can increase and decrease the transparency of the whole quad, say for like fading black or gray smoke?

Share this post


Link to post
Share on other sites
Advertisement
You can create your texture with or without an alpha channel as needed. You can also set alpha for each of the vertices of the quad you are drawing.

Each vertex can have a diffuse color specified (eg. glColor4ub(r,g,b,a), glColor4f(r,g,b,a), etc...). Just specify the alpha you desire at the same time you specify the diffuse color, and the alpha values of the 4 vertices will be interpolated across the quad, and mixed with the alpha channel of the texture.

glBegin(GL_QUADS);

glColor4ub(Red, Green, Blue, Alpha);

.
.
.

glEnd();

Josh
vertexnormal AT linuxmail DOT org


Check out Golem at:
My cheapass website

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!