semi transparent texture opengl 2

Started by
1 comment, last by grohank 12 years, 11 months ago
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
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

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

This topic is closed to new replies.

Advertisement