Advertisement

Alpha Channel & Multitexture

Started by January 17, 2002 08:12 AM
2 comments, last by Daywalker313 23 years, 1 month ago
I''m loading tga''s with alpha channel (gluBuild2DMipmaps(GL_TEXTURE_2D, 4, width, height, GL_RGBA, GL_UNSIGNED_BYTE, data) and I want to use the Alpha Channel with multitexturing. I''ve tried different parameters (glTexEnvf...), but all i got was that the color white got transparent.
Well, don''t know why only the color white is transparent.
But every rgb pixel is transparent when the responding a (alpha) pixel is 0.

So i would say you have to check your alpha channel
Advertisement
A little example:

You have got a texture with a flame and a black background.
So if you want that the color black is transparent then must
every black pixel have to had 0 (transparent) on the alpha channel and the rest 255 (visible).

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

Drawing

Sorry for my english, i know that it is not the best
Hi,

On my site, I''ve a example for using multi-texturing and another for alpha chanel for TGA.

========================
Leyder Dylan
http://ibelgique.ifrance.com/Slug-Production/
========================Leyder Dylan (dylan.leyder@slug-production.be.tf http://users.skynet.be/fa550206/Slug-Production/Index.htm/

This topic is closed to new replies.

Advertisement