unity3d-jp / StreamingImageSequence

A package for playing sequential image sequences in Unity Timeline
Other
283 stars 39 forks source link

Flickering #361

Closed gangogames closed 2 years ago

gangogames commented 3 years ago

Tried using streaming assets and imported assets. In both cases, I get flickering during playback. With streaming assets there is little flickering in the editor and a similar experience in a Win64 build. When using imported sprites, I get no flickering in the editor, but very strong flickering in the win 64 build. My source images are 640x360 pixels png. Looks like the images can not be loaded fast enough. In that case I would prefer if the previous frame would be shown instead of nothing.

sindharta commented 3 years ago

When using imported sprites, I get no flickering in the editor, but very strong flickering in the win 64 build.

No flickering in the editor is expected in this mode, but I am surprised to hear that it works at all in a build, even with very strong flickering, because my expectation is that it should not work at all in runtime. We do have a plan to support imported images in runtime, but this might take some time.

In the meantime, as you suggested, it might be good if we have an option (checkbox) to show the previous frame or not, if an image fails to load (or is still in the process). I'll keep you posted.

gangogames commented 3 years ago

Thank you for the reply. Looking forward to that new feature.

sindharta commented 3 years ago

Version 0.12.0-preview added a new option "Use Last Image on Load" in StreamingImageSequenceRenderer component, which can be used to address this issue.

Please try it and let us know how it goes.

sindharta commented 3 years ago

Closing the issue for now. Please feel free to reopen if necessary

EricBatlle commented 3 years ago

Hi, I'm also having a flicker issue, seems like if I play several times the sequence, every time have less flicker, is this expected? :S Using Unity 2019.4.13f1 Empty project, with only this plugin, and UnityInGameDebugConsole

https://user-images.githubusercontent.com/15261880/139913721-5372c602-49e4-402b-8164-d14e74cfd24c.mp4

:

sindharta commented 3 years ago

A couple of questions:

  1. Where are the images located ? Are they under Assets ?
  2. How big are the images ?
  3. How much memory does your PC have ?
EricBatlle commented 3 years ago

A couple of questions:

  1. Where are the images located ? Are they under Assets ?
  2. How big are the images ?
  3. How much memory does your PC have ?

1.StreamingAssets, and yes, under Assets. 2.Some of them 1920x1080 and others 512x256 3.16GB

sindharta commented 3 years ago

1920x1080 images are quite big for pictures put in StreamingAssets, and 16GB might not be enough to store all of them in memory.

Are you using SSD drive ? And, have you taken a look at the folder tradeoffs doc ?

EricBatlle commented 3 years ago

1920x1080 images are quite big for pictures put in StreamingAssets, and 16GB might not be enough to store all of them in memory.

Are you using SSD drive ? And, have you taken a look at the folder tradeoffs doc ?

Well, i'm using only 12 images 1920x1080 and 30 512x256, a total of 16.5MB...sounds like 16GB of memory should be enough ^^' which are the benchmark of your software? Also I'm checking my Memory and CPU usage, and it doesn't move an inch, so it doesn't seems a hardware bottleneck.

And yes, I'm using a SSD drive and I've take a look on folder tradeoffs. :(

sindharta commented 3 years ago

If the image is put in StreamingAssets, or outside Assets, then actually, the image is converted into RGBA32, meaning that, one 1920x1080 texture will cost (1920x1080x4), which is around 8 MB.

That being said, you don't have a lot of images, and simple math indicates that loading all your textures takes less than 120 MB.

Do you have flickers even after waiting a bit ? StreamingImageSequence automatically loads all the images in memory, so it's expected to have flicker when you scrub the timeline at the beginning, but you should not see any flicker after waiting for a few seconds.

And just to confirm, are you using this in the editor only ? or in runtime as well ? And I guess you are using StreamingImageSequence@0.14.1-preview ?

EricBatlle commented 2 years ago

If the image is put in StreamingAssets, or outside Assets, then actually, the image is converted into RGBA32, meaning that, one 1920x1080 texture will cost (1920x1080x4), which is around 8 MB.

That being said, you don't have a lot of images, and simple math indicates that loading all your textures takes less than 120 MB.

Do you have flickers even after waiting a bit ? StreamingImageSequence automatically loads all the images in memory, so it's expected to have flicker when you scrub the timeline at the beginning, but you should not see any flicker after waiting for a few seconds.

And just to confirm, are you using this in the editor only ? or in runtime as well ? And I guess you are using StreamingImageSequence@0.14.1-preview ?

Sorry for the late response @sindharta. Yes, I've flickers when waiting for a bit. Even after waiting for a few seconds, I've the same behaviour, it only enhances when calling to reproduce more than once. I've used in editor (with and without playmode). Yes, version 0.14.1-preview.

Soon I'll push a repo that only reproduces this behaviour so you can test if I'm missing or building something wrong ^^ Thanks!

sindharta commented 2 years ago

Closing issue due to inactivity. If you are still having this issue, please let me know the repo we can use to reproduce this error