New TextureFormat parameter

  ... information about changes and new features of AndEngine,

New TextureFormat parameter

Postby Nicolas Gramlich » Fri Jun 24, 2011 1:13 pm

Hello Community,

The changes originate from the patches supplied by the user zergling_zzh made during the development of the Z-Studio game "ZDefense", which btw is super awesome and addictive :( :? :lol:


recently I introduced a new parameter when creating a Texture, the so called TextureFormat (an Enum). Currently it has two values RGBA_8888 and RGB_565. RGBA_8888 was the previous default. The reason I introduced this is that not every time you have Textures that need transparency, quite often for opaque backgrounds. So when using RGBA_8888 we are basically wasting 25% of the data.

This is where RGB_565 jumps in, as it does not have an Alpha channel and also it reduces the color channels from 8 to 5(red, blue) 6(green) bits, resulting in a Texture that is using 50% less space, when compared to RGBA_8888. On the other hand, when using RGB_565 we obviously lose some color accuracy, having only 2^16 = 65.536 instead of 2^24 = 16.777.216 different colors. Depending on the Texture you are using this loss in color accuracy might not be noticeable and could give you a speedup of somewhere around 5 to 20% :!: Especially as it is so simple to try this change, it is definitely worth a try, especially for backgrounds.

Best Regards,
Nicolas
Nicolas Gramlich
Site Admin
 
Posts: 1734
Joined: Mon Jun 07, 2010 6:20 pm
Location: Schriesheim, Germany

Re: New TextureFormat parameter

Postby dorasoft » Fri Jun 24, 2011 6:29 pm

Nice update :) Would be useful for my cell-game, even when I have used Sprite Batch!
dorasoft
 
Posts: 87
Joined: Sat Jun 18, 2011 4:06 pm


Return to Updates

Who is online

Users browsing this forum: Hiteshc and 2 guests