Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
How much texture sheets can I reasonable load? — Gideros Forum

How much texture sheets can I reasonable load?

RogerTRogerT Member
edited February 2013 in General questions
Hi guys,
I am planning a new project and I believe I might need about 20 texture sheets, 2048 х 2048 each.
What do you think, wound an average iphone/android be able to load this into memory?

Thanks )

Likes: RogerT

+1 -1 (+1 / -0 )Share on Facebook

Comments

  • jdbcjdbc Member
    edited February 2013
    I think you can load this texture sheets, but the question is when they must be loaded, on demand or at the beginning.

    I suggest to load texture sheets when you need it, and uses pauses for loading processes.

    Likes: RogerT

    +1 -1 (+1 / -0 )Share on Facebook
  • That is a lot of textures.

    20 x uncompressed images would consume 320MB RAM (20 x 2048 x 2048 x 4 - the 4 is the RGBA per pixel of your texture) which is quite a lot.

    Are all of these textures used on screen at the same time??

    If so then I think your project could end up running quite slowly as that's a lot of memory to be throwing around every frame.

    I also assume that this is an iPad only project??

    Likes: RogerT

    +1 -1 (+1 / -0 )Share on Facebook
  • jdbcjdbc Member
    edited February 2013
    That is a lot of textures.

    20 x uncompressed images would consume 320MB RAM (20 x 2048 x 2048 x 4 - the 4 is the RGBA per pixel of your texture) which is quite a lot.

    Are all of these textures used on screen at the same time??

    If so then I think your project could end up running quite slowly as that's a lot of memory to be throwing around every frame.

    I also assume that this is an iPad only project??
    JPEG and PNG images are compressed so images would consume quite less than 320mb.

    Anyway the best option is loading images only when you needed. I suppose that libpng library can manage this textures in memory.

    Likes: RogerT

    +1 -1 (+1 / -0 )Share on Facebook
  • RogerTRogerT Member
    edited February 2013
    Thanks for the answers, guys. Most of this sprite sheets contain sprites for one character, so it needs to be leaded at the beginning, and there would be only one frame ( about 164x164 ) on screen at given time.

    No, this isn't an iPad only project, it's orientated to regular androids and iphones.

    I just made a test of loading 1500 frames ( on 7 sheets ), took about 20 seconds to load which, i think, is not bad. ) angrybirds takes 15 seconds to load up.

    Haven't heard of libpng before... is it a lib that I put into Gideros?

    Likes: RogerT

    +1 -1 (+1 / -0 )Share on Facebook
  • JPEG and PNG images are compressed so images would consume quite less than 320mb..
    Makes no difference once they're loaded into texture memory - regardless of the compression of the source file, they'll take the same amount of space in texture memory.

    Likes: MikeHart, RogerT

    +1 -1 (+2 / -0 )Share on Facebook
  • @RogerT: Some Android devices can only handle textures up to 1024x1024. I'm not sure which ones but It's something I'd look into. Also, you're talking about 20 sprite sheets for your main character, what about backgrounds, fonts and other misc images??

    Likes: RogerT

    +1 -1 (+1 / -0 )Share on Facebook
  • RogerTRogerT Member
    edited February 2013
    Luckily I just learned that 20 was a bit exaggerated :) , I managed to squeeze 1500 frames of my character into this 7 sheets and I guess the background, fonts, etc. might take another roughly 3 sheets of the same size. So in all, I'm sure it won't be more then 10 of this sheets for the whole game. Probably they'll take about 25 seconds to load, which I hope isn't too bad. )

    oh, and I used the standard gideros texture packer, with the one from codeandweb I might get it even tighter. )

    Likes: RogerT

    +1 -1 (+1 / -0 )Share on Facebook
  • At the end of the day, the texture frames will get stored in main memory (the amount of which depends on the machine). When you want to draw an image that's stored on a texture OpenGL will change it's internal state and make that texture active - again some machines can handle max sizes of 1024x1024, some 2048x2048, it depends on the machine. It's that internal state change that really slows things down as it has to DMA the image from main memory to vram (and hence why the idea of texture atlases is so good).

    I'd actually suggest you reorganise your anims as it's little point having access to 1500 frames on the same page as you can't show them all at once and you'll be uloading a massive texture just so's you can draw one image, you actually want the main (most used frames) on the same page as the MAJORITY of your screen imagery so as to minimise the number of texture state changes, you'd also probably find it more efficient to store each frame separately (or in smaller chunks) so that when you DO have to make the change to redraw then your not uploading too much extra.

    Likes: RogerT

    WhiteTree Games - Home, home on the web, where the bits and bytes they do play!
    #MakeABetterGame! "Never give up, Never NEVER give up!" - Winston Churchill
    +1 -1 (+1 / -0 )Share on Facebook
Sign In or Register to comment.