PDA

View Full Version : Transparent Textures



Reb_Crush
06-14-2001, 12:10 PM
Hello all,

In my code I am loading textures from file in RGBA format. Now I was wondering how I could use the A element to set the transparency of the texel. I have tried using GL_Blend in glTexEnvf, but the image looks all screwed up then( I think it's being inverted ), though any of the other functions works fine( but doesn't do transparency ). How should I get this to work properly?

Thsnks,

Reb Crush

zed
06-14-2001, 04:54 PM
glBlendFunc( GL_SRC_ALPGA,GL_ONE_MINUS_SRC_ALPHA)
will blending the texture with the frame buffer depending on the textures pixels alpha value. ie 1 for totally replace the colour in the framebuffer and 0 for leave it the same. between 0-1 for a mix of the 2

Leyder Dylan
06-15-2001, 12:29 PM
Hi,

On my site : http://ibelgique.ifrance.com/Slug-Production

"Download" section, I've a little example who display a tree using the alpha chanel.

Reb_Crush
06-16-2001, 02:29 AM
Somehow it does work now with GL_REPLACE.... Hmmmm, strange.

Well, C does that more often =)

Anyway, thanks!