Search Unity

How to display a super HD image without consuming too much cache or crashing?

Discussion in 'General Graphics' started by roseportalgames, Jun 12, 2020.

  1. roseportalgames

    roseportalgames

    Joined:
    Aug 9, 2017
    Posts:
    173
    I have a huge world map image that I want to display and allow the player to pinch and zoom in and scroll around the details.

    This could easily be over 16k by 16k pixels, so I'm thinking about some sort of system where it loads LQ only at first and then loads HQ when it zooms in. But I haven't come across a perfect system, because it still loads in all the HQ versions into the memory/cache even when they're not active, and then on iPhones the app crashes.

    Does anyone have any recommendation?
     
  2. cosmochristo

    cosmochristo

    Joined:
    Sep 24, 2018
    Posts:
    250
    mip maps were designed to reduce the storage of a multiresolution pyramid of an image while still preserving the details. You might find a solution based on that method. I normally make a multiresolution (LOD) tree of tiles for Earth and map a matching set of images to the tiles. However, I do not have a very efficient implementation atm.

    Also. most approaches in mapping stream the LOD tiles on demand.
     
    roseportalgames likes this.
  3. cosmochristo

    cosmochristo

    Joined:
    Sep 24, 2018
    Posts:
    250
    BTW, where did you get the image from? I use two 21600pix square images from the NASA SRTM (Shuttle Radar Topography Mission), one for East one for West.
     
    roseportalgames likes this.
  4. roseportalgames

    roseportalgames

    Joined:
    Aug 9, 2017
    Posts:
    173
    Oh my God, I can't believe I forgot about LODs. I worked a lot with them, just mostly 3D models.

    The image was drawn for a part of the Netherlands. It's like an awesome comical fantasy map with lots of details, therefore it needs a zoom. It also can't be remade in Tilemap editor because of the different textures and detail.

    Would you recommend using LOD and mip map or focus purely on one or the other?
    Also do I need to be using asset bundles with Load/Unload to reduce cache or is that no longer relevant because of LOD and mip map?

    Thanks so much cosmochristo!
     
  5. cosmochristo

    cosmochristo

    Joined:
    Sep 24, 2018
    Posts:
    250
    Are you talking about the Neanderthals game? https://en.wikipedia.org/wiki/Video_games_in_the_Netherlands?
    sounds pretty amazing.
    I would say start with a quadtree LOD algorithm. If you are targeting phones then I expect you need to stream the terrain and active objects. As for mip maps, that is an old bu brilliant invention fro way back and hopefully you can find something that combines both. There is some unity mip map streaming support, I believe, but not something I have investigated.
    Sorry I can't give you much more specific advice as my work is more on the framework for general positional simulation at any scale, accuracy: Earth and space, like in the videos on: https://www.youtube.com/channel/UCpi9nP_1DumSTkPMhfniimw