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
semi transparent texture opengl 2
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
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
Are you already using texture mapping in RGBA mode ? If you are then this should cut it.
In order to use blending, you should make sure that your code draws opaque images before the semitransparent ones.
[color="#4169e1"]more on blending
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
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement