tga prob
ok im loading the tga perfectly fine for 24bit/32bit and for rle compression...but when i try to load in with transparency and use src/1-src alpha etc but it still just loads it as if nothing was different... anyone got a tga file that is definitely made correctly with an alpha channel i could test and see if its my image or how im loading it or what?
What does it look like? just as tho'' its black and white, or that you can''t see anything?
If it does, remember that you have to enable blending funcs to use transparency
If it does, remember that you have to enable blending funcs to use transparency
ya im doing this...
and all it shows is this... here
i have no idea what to do now and its starting to get real frustrating ;\
[edited by - AbsentMinded on July 25, 2003 9:31:49 PM]
[edited by - AbsentMinded on July 25, 2003 9:32:16 PM]
[edited by - AbsentMinded on July 25, 2003 9:32:56 PM]
[edited by - AbsentMinded on July 25, 2003 9:34:52 PM]
glEnable(GL_BLEND);glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);// do the texturing/drawingglDisable(GL_BLEND);
and all it shows is this... here
i have no idea what to do now and its starting to get real frustrating ;\
[edited by - AbsentMinded on July 25, 2003 9:31:49 PM]
[edited by - AbsentMinded on July 25, 2003 9:32:16 PM]
[edited by - AbsentMinded on July 25, 2003 9:32:56 PM]
[edited by - AbsentMinded on July 25, 2003 9:34:52 PM]
Try this:
glEnable(GL_ALPHA_TEST);
glAlphaFunc(GL_GEQUAL, 0.3f);
// do the texturing/drawing
glDisable(GL_ALPHA_TEST);
That should do the trick.
EDIT:
The alpha test will take out the black area, you don't need to use:
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
// do the texturing/drawing
glDisable(GL_BLEND);
unless you want to keep it transparent.
[edited by - UltimaX on July 25, 2003 9:37:54 PM]
glEnable(GL_ALPHA_TEST);
glAlphaFunc(GL_GEQUAL, 0.3f);
// do the texturing/drawing
glDisable(GL_ALPHA_TEST);
That should do the trick.
EDIT:
The alpha test will take out the black area, you don't need to use:
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
// do the texturing/drawing
glDisable(GL_BLEND);
unless you want to keep it transparent.
[edited by - UltimaX on July 25, 2003 9:37:54 PM]
ARGGGG It worked on my font class, I had the same problem... hmmmmm
Did you try:
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
-UltimaX-
"You wished for a white christmas... Now go shovel your wishes!"
Did you try:
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
-UltimaX-
"You wished for a white christmas... Now go shovel your wishes!"
nah ;\ im gonna send the project to the email in your profile take a look at it if you want...you could try some of your own tga files too and see if thats the problem heh if anyone else wants it to look at lemme know
All right, I''ll get back with you in a few.
-UltimaX-
"You wished for a white christmas... Now go shovel your wishes!"
-UltimaX-
"You wished for a white christmas... Now go shovel your wishes!"
Found the problem.
Change:
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
With:
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
-UltimaX-
"You wished for a white christmas... Now go shovel your wishes!"
[edited by - UltimaX on July 25, 2003 10:20:11 PM]
Change:
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
With:
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
-UltimaX-
"You wished for a white christmas... Now go shovel your wishes!"
[edited by - UltimaX on July 25, 2003 10:20:11 PM]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement