Jump to content
  • Advertisement
Sign in to follow this  
giugio

OpenGL semi transparent texture opengl 2

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

Hello.
I use devil to load a semitransparent texture, how i can display a semitrasparent texture with opengl?
I have arleady the raw data of the image,(a .png), extracted with devil.
thanks

Share this post


Link to post
Share on other sites
Advertisement
use Blending omg>?

glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);







remember thah you must load alpha channel to ogl i dont know what is devil anyway

Share this post


Link to post
Share on other sites
Are you already using texture mapping in RGBA mode ? If you are then this should cut it.


glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

// Draw object with semitransparent texture

glDisable(GL_BLEND);


In order to use blending, you should make sure that your code draws opaque images before the semitransparent ones.

[color="#4169e1"]more on blending

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!