Maximum bitmap dimension
by Amjad Yahya · in Torque 2D Beginner · 08/13/2013 (1:39 am) · 7 replies
The maximum bitmap dimension allowed by T2D is 2048 pixels, however, in TGB it was higher; my question is why 2048 in particular? Could someone explain the concept behind this.
About the author
#2
Most devices (up until recently) had a maximum texture size of 2048x2048. It's the safest value that should work on most video cards and devices. One such image takes up (maybe my math is wrong) 16 MB in memory, which isn't much but adds up fast if you have memory constraints.
For instance, only the Iphone 4S and upwards support more than 2048x2048 and the iPad 1 & 2 (before iOS 5.1) supported only 2048x2048 textures as well.
I think the following lines determine the maximum texture size in Torque2D/Graphics/TextureManager.h
Feel free to change it if you target relatively modern PCs/MACs.
08/13/2013 (2:06 am)
-> What Jon said :)Most devices (up until recently) had a maximum texture size of 2048x2048. It's the safest value that should work on most video cards and devices. One such image takes up (maybe my math is wrong) 16 MB in memory, which isn't much but adds up fast if you have memory constraints.
For instance, only the Iphone 4S and upwards support more than 2048x2048 and the iPad 1 & 2 (before iOS 5.1) supported only 2048x2048 textures as well.
I think the following lines determine the maximum texture size in Torque2D/Graphics/TextureManager.h
#define MaximumProductSupportedTextureWidth 2048 #define MaximumProductSupportedTextureHeight MaximumProductSupportedTextureWidth
Feel free to change it if you target relatively modern PCs/MACs.
#3
So 2048 is the most suitable value for old and new hardware?
08/13/2013 (2:18 am)
Thank you both. That was helpful.So 2048 is the most suitable value for old and new hardware?
#4
08/13/2013 (2:36 am)
Yup.
#5
08/13/2013 (2:49 am)
Is it better to use the "power of 2" rule in terms of performance?
#6
08/13/2013 (3:09 am)
From the ImageAsset guide:Quote:For the image to be uploaded as a texture however it must be a power-of-two in size but Torque 2D will internally re-size it if this is not the case so that it can be uploaded. Torque 2D will not modifie the image on the disk, it does this in-memory prior to uploading as a texture so the change is completely volatile. It also has to do this whenever the asset is loaded from disk and so whilst the process is very fast, it does waste a little time but more importantly is wasted memory on the graphics card. It also only adds extra space to the right and bottom of the image, it does not rescale or change the image in any way so this change is completely transparent but is done purely for the benefit of the graphics card.
#7
08/13/2013 (3:44 am)
Thanks Mike
Jonathan Arsenault