• Advertisement

Archived

This topic is now archived and is closed to further replies.

tga prob

This topic is 5328 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
Advertisement
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

Share this post


Link to post
Share on other sites
ya im doing this...


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

// do the texturing/drawing


glDisable(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]

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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!"

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
All right, I''ll get back with you in a few.

-UltimaX-

"You wished for a white christmas... Now go shovel your wishes!"

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
damn right thanks man i hate it when that happens lol i dont even remember seeing that glTexEnvi() part of the code there from all the times i went over it ;p

Share this post


Link to post
Share on other sites
You''re welcome

-UltimaX-

"You wished for a white christmas... Now go shovel your wishes!"

Share this post


Link to post
Share on other sites

  • Advertisement