Search Unity

Texture allocation different between Windows and IOS project

Discussion in 'Editor & General Support' started by briosh, Dec 30, 2011.

  1. briosh

    briosh

    Joined:
    Aug 9, 2010
    Posts:
    17
    I am working on a iOS game on a windows PC and I transfer the project to a MacBook for building.

    Recently the game started crashing alot, more often between loadings. I cheched the instruments and saw large memory usage like 60+ mb

    After looking around I realized that the Used Textures in the statistics window report different values in each system.

    For example, while running a specific level on the PC, Unity reports 30 used textures of a total of 12MB but when running the project on the MacBook as an iOS project, it reports 30 used textures of 29MB !
    Also, the VRAM usage is doubled! Approximately 17MB on the PC, 31-40 on the MacBook ( and I suppose on the iPhone/iPad too as It explains the 60MB of total memory usage )

    Any idea why this is happening?
    Or maybe where or what should I start looking for?

    - I use automatic compression (which results in PVRTC 4bits for the iOS)
    - Most of the scene is 'static' and use lightmaps (but even without them nothing changes)
    - I combine children wherever possible
    - The textures have no mipmaps

    I don't know what else should I report... If anyone can help, feel free to ask anything
    (only problem is I can't show the project yet)
     
    Last edited: Dec 30, 2011
  2. sama-van

    sama-van

    Joined:
    Jun 2, 2009
    Posts:
    1,734
    Yeah first of all, PC, MAC and iOS aren't the technology.

    Well, that is important to work near of your iOS and to compile something when you add more asset.
    Then with time you can understand how to deal with.

    Of course texture compression can help for it. Try to test the PVRTC 2 bits, sometimes it doesn't make any difference with PVRTC 4 bits... But reduce texture size as well.

    To "combine children" (objects?) is a good idea, but only if they share the same material.
    When drawing the scene it will render each objects separately using a different material anyway.

    Now when it comes of mip-mapping there are 3 things to note :
    - yes if you say mipmapping on iOS is really crap, and pixel give better result without that thing.
    - yes if you say it will reduce a little bit texture size into the app,
    - but note this Mipmapping is still an optimization process in runtime,then to remove it can affect your stats :(
    ------ http://en.wikipedia.org/wiki/Mipmap

    Also on iOS, there is not really V-Ram... I think that is a complete allocation about physical and video memory.
    Everything into the same bag!! Then memory max depends of the device...

    Also be-careful, some device will run HD and that could double some memory resource as well ^_^!!
    For exemple you can get 60FPS on a 3GS as it can give 40FPS on ipod2 with HD mode o_<


    Last advise : alpha stuff aren't friendly use on iOS!
     
    Last edited: Dec 30, 2011
  3. briosh

    briosh

    Joined:
    Aug 9, 2010
    Posts:
    17
    Thank you very much Sama.van, some of those stuff i am aware of, but its good to hear from an other developer :)
    the important issue is the reported texture memory.

    I will work more thoroughly on the MAC and try to figure out why so much difference.
    PVRTC compression is probably the answer...

    Unfortunately i can't use mipmaps because we need a crystal clear 'cartoon' feel for our game :(