Search Unity

Image sequence, really large size, possible?

Discussion in '2D' started by JDMulti, Aug 26, 2015.

  1. JDMulti

    JDMulti

    Joined:
    Jan 4, 2012
    Posts:
    384
    A customer asked me to create an application which I could realize in Adobe Flash in combination with AIR or just create it with the 2d tools of Unity. The reason I choose for this, is because Unity has many features to be able to make a nice GUI based application with animations, 2.5d effects and export to a lot of platforms.

    However, a part of the application is about rotating a pre-rendered 3d object. The reason for this to be pre-rendered is because those 3d models are really heavy models which contain about millions of polygons, basicly a really heavy ship model. There is no way to make them low-poly, as the customer wants to see almost every single detail in this ship.

    With Flash this won't be an issue, as I preload those image sequences first, let the user wait for loading and then being able to scroll trough the image sequence as it was a rotate-able object. However I do have doubts if this is possible in unity, because those images are at least size: 1920x1080 and I've got 360 of them.

    My question is, does anyone have experience with image sequences this scale and if it's possible before I spend days to get it working and hit a really hard wall?

    I've done loading image sequences in unity before, the largest was about 1024x1024 and 200 frames. However when doing this, Unity would hang for 5/10 seconds and after loading a second sequence it would instantly crash. Maybe I was doing things wrong, but maybe someone has experience with this and could help me if this is possible and how to do it efficiently memory and performance wise.
     
  2. JDMulti

    JDMulti

    Joined:
    Jan 4, 2012
    Posts:
    384
    I guess this way of working with image sequences is a no go? As for now, being able to use such an image sequence, memory handling should be a huge part of it to be able to get it smoothly integrated withing the unity application.
    I'll just try it and see how far I'll come, still hoping on someone who has done this before and can tell if it's possible to get it done well and smoothly.
     
  3. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,434
    Tried something similar in flash long time ago, didnt work with several hundreds of images..(also rewinding movie frames was too slow), eventually just used vb.net and loaded each frame from disk while playing anim, it was fast enough from local drive.

    so i guess in unity could just load few frames ahead while rotating it..(in desktop)

    not sure if some of the asset store videoplayers would work, if they allow easy frame by frame playing/rewind,
    smaller file with mp4 video..
     
  4. imaginaryhuman

    imaginaryhuman

    Joined:
    Mar 21, 2010
    Posts:
    5,834
    Maybe better off recording it into a video and using compression to cut down the data size, then scrubbing the video for playback.
     
    blizzy likes this.
  5. JDMulti

    JDMulti

    Joined:
    Jan 4, 2012
    Posts:
    384
    The reason that I want to use an image sequence is because it needs to run on Android and iOS as well. For desktop I think it would be less of a problem, because you can access the disk with ease and the machine has more power. Or is there a video playback option for mobile platforms that works well without launching an external player?

    Also a problem I found out, is the image compression. While I'm able to compress a 1920x1080 file into a 600kb png image, unity turns the image into a texture 2d which eats up at least 3+mb per image not to mention when I want to use an alpha mask. The amount of memory that's being used will raise to 1GB+ additionally of what Unity engine is using.
    Video would indeed be better if it also supports the alpha mask.
     
  6. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,434
    you could crop the images also, no need to keep those transparent borders,
    and having less frames.. instead of 360, test with 180 or more.
     
  7. Stamblew

    Stamblew

    Joined:
    Sep 3, 2014
    Posts:
    22
    Apologies for reviving this post, but as there is no specific answer, I'd like to know how can I load a image sequence (100 images of 1920x1080 each) in a memory efficient way that most mobile phones nowadays can handle.

    I've been trying to use AssetBundles and load just a small set of images and load the rest on-demand, but I am not 100% satisfied with the result. Can someone could point out some other approaches, please?