Jump to content
  • Advertisement
Sign in to follow this  
giugio

OpenGL semi transparent texture opengl 2

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

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!