Adding 256 color mode with user defined transparency
by Alain Labrie · in Torque Game Builder · 10/23/2010 (3:05 pm) · 6 replies
In an attempt to save memory, I am investigating converting art assets to 256 color and using magenta as the transparent color. It's a little old school, but a 256 color image can use as little as 1/4 the ram of a RGBA, and this would make it possible to have up to 4 times more sprites for the same memory footprint.
So has anyone done this for TGB,iTGB? Please don't say "key mode" since that only serves to delineates rectangular images for each other. I have been searching but so far nothing...
So has anyone done this for TGB,iTGB? Please don't say "key mode" since that only serves to delineates rectangular images for each other. I have been searching but so far nothing...
About the author
#2
10/23/2010 (4:29 pm)
I tried PVR in the past on sprite sheets, and the results were less then great. it added a lot of garbage pixels in the transparent areas...
#3
10/23/2010 (4:36 pm)
It shouldn't be adding garbage at all in transparent areas, so that's weird. At least things look alright when I use Apple's texturetool.
#4
10/23/2010 (4:42 pm)
I have not tried Apple's texture tool, I have been using the tool that ships with iTorque2D (iTGB), can't recall what it's called... but it adds garbage around the edges, probably does not like the blended edges. Maybe I will try it with a more solid pixel border.
#5
There is a certain threshold you need to adjust for, too. I think every sprite needs at least a pixel or two on each edge to not suffer from colour bleed. It *is* capable of proper transparency, and the sprites in the Adventure Kit have very generous transparent areas around most cells for their animated characters. If the sprites are touching, PVR will do a very bad job.
On desktop it doesn't matter; you have craploads of RAM even on the cheapest piece of crap "netbook" laptop-wannabe :)
10/23/2010 (4:46 pm)
To quote a doctor: Yeah, stop doing that :)There is a certain threshold you need to adjust for, too. I think every sprite needs at least a pixel or two on each edge to not suffer from colour bleed. It *is* capable of proper transparency, and the sprites in the Adventure Kit have very generous transparent areas around most cells for their animated characters. If the sprites are touching, PVR will do a very bad job.
On desktop it doesn't matter; you have craploads of RAM even on the cheapest piece of crap "netbook" laptop-wannabe :)
#6
When I said that "it added garbage around the edges", I did not mean around the cell border, but I meant on the outline edges of the sprites. i.e. around the legs or arms...
10/23/2010 (5:27 pm)
@RonnyWhen I said that "it added garbage around the edges", I did not mean around the cell border, but I meant on the outline edges of the sprites. i.e. around the legs or arms...
Torque 3D Owner Ronny Bangsund
Torque Cheerleaders