View Full Version : Creating TGA files...

02-19-2003, 05:20 PM
Seth, I was wondering what you use to create your Sprites for your 2D games (like space mario)?

I have been doing a DirectX game which requires graphics with transparency. I create them in Photoshop, but I have to save them as TGA's using Paint Shop Pro, because Photoshop doesn't seem to save them correctly. Everything has a white border.

Are PNG's better than TGA's maybe?? I dunno..
there isn't much talk about TGA's on the internet as far as DX is concerned. Just wondering how you do things. I can never get opaque stuff to look the same in DX as it does in Photoshop.


02-19-2003, 10:58 PM
I use Photoshop to create my TGA's and save them and the alpha channel works fine.

Are you using d3dx to load them? If you are getting weird borders you can probably fix this by setting some render state tolerances. (you can set to not show anything < 50% transparency, etc)

02-20-2003, 03:45 PM
Cool. I got it working. I just had to set my colorkey to 0xFFFFFFFF when I loaded my TGA&#39;s.

Strange, because with colorkey=0 it works with the Paint Shop Pro saved TGA&#39;s correctly. They must do something differently.

Thanks for the help&#33;

02-20-2003, 04:31 PM
I spoke too soon. Changing the colorkey worked as long as there was no translucent parts (just totally transparent).

However, Photoshop isn&#39;t saving ANY transparent stuff..
I tested it out by loading TGA&#39;s done with Photoshop and loading from the alpha channel, compared to those done with PaintShop. PaintShop has alpha channel info, Photoshop does not.

However, if I have my PSD loaded, and I have my layer transparency selected, then go to Select->Save Selection, I can create an Alpha channel that way.
Did you have to go through all that just to get an alpha channel? Or maybe there is some setting I have wrong in Photoshop..?