Hi,
I''ve been playing with tga files, and trying to get transparencies in my images, except i''m not sure what i''m doign wrong.
I''m pretty much using Nehe''s Lesson 34 TGA loading code to load compressed/uncompressed tga''s. So, if I add an alpha (mask/channel) to an image, am i going to have to rethink the loading code? I tried without changing the code, and the image is quite garbled.
Any help would be really appreciated.
Scott
------------------------------------------------------------
Email
Website
"If you try and don''t succeed, destroy all evidence that you tried."
------------------------------------------------------------
Son of a crap, question about alpha/tga stuff
I''m pretty darn sure you do actually need to rethink your code... That or you could just use *surprise surprise - my fave IL* OpenIL / DevIL / whatever DoomWiz has called it now 
What you have to do is load not 2 bytes, not 3 bytes, but 4, full, bytes per pixel value! (Can you believe that??? What a damn waste...) That''s right that''s 2 DWORDs, 4 WORDs or 32 bits - per damn pixel!!! Check out wotsit (www.wotsit.org) if you need some tables to help you figure out how to load a TGA file + alpha channel.
Just a coupla notes, I''m sure you''ve already done this but just in case:
1) Dont forget to enable blending (Verrrry important)
2) Dont forget to set the right -blend mode- (Also very important...)
3) Play around with your alpha channel - variable opacity is kewl :D
Hope that helps some!
-------- E y e .Scream Software --------
----------------------------------------
/-\
http://www.eyescream.cjb.net | * |
\-/
----------------------------------------

What you have to do is load not 2 bytes, not 3 bytes, but 4, full, bytes per pixel value! (Can you believe that??? What a damn waste...) That''s right that''s 2 DWORDs, 4 WORDs or 32 bits - per damn pixel!!! Check out wotsit (www.wotsit.org) if you need some tables to help you figure out how to load a TGA file + alpha channel.
Just a coupla notes, I''m sure you''ve already done this but just in case:
1) Dont forget to enable blending (Verrrry important)
2) Dont forget to set the right -blend mode- (Also very important...)
3) Play around with your alpha channel - variable opacity is kewl :D
Hope that helps some!
-------- E y e .Scream Software --------
----------------------------------------
/-\
http://www.eyescream.cjb.net | * |
\-/
----------------------------------------
hehe, i was about to reply complaining that i still couldn''t get it to work, then i figured i''d try it one more time to make sure it in fact still doesn''t work, and... well, it worked 
kick ass, i''m finally past this damn roadblock that''s been keeping me from proceeding for a while now
thanks for the help!
Scott
------------------------------------------------------------
Email
Website
"If you try and don''t succeed, destroy all evidence that you tried."
------------------------------------------------------------

kick ass, i''m finally past this damn roadblock that''s been keeping me from proceeding for a while now

thanks for the help!
Scott
------------------------------------------------------------
Website
"If you try and don''t succeed, destroy all evidence that you tried."
------------------------------------------------------------
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement