Textures streaming issues

Hey,

For the last year or so over several projects I have had consistent issues with texture streaming.

The first major issue is with textures getting low desired mip levels for apparently no reason. Textures hundreds of meters away, on culled/ objects, or even textures which are no longer in the scene often have a desired mip level of 0, which is problematic as it leads to an unnecessarily full pool, which then fails to load actual important textures. This remains true even if discarding is enabled.

The second big (newer) issue is occasional 50ms+ stalls during TextureStreamingManager.Update.

It also appears like there is an issue with textures which have had a required mip requested, then cleared, not ever unloading correctly, but it is hard to tell if this is related to the first problem or a unique issue.

The settings we are using are not extreme in anyway, but I have experimented with no success.
Budget: 512
Renderers Per Frame: 256
Max Reduction: 4
Max IO: 512

I would like to know if anyone has had much luck with texture streaming, or if anyone has been able to resolve these issues.

Thanks a lot,
Chris

It would be useful to know which Unity version you have experienced issues with.
If you can raise bugs with reproduction steps we can take a detailed look into these issues.

There was a bug in some early 2019 releases where textures that were not associated with a renderer would be requesting mip 0 rather than the max mip reduction level. This is resolved in the later releases.

The spike in TextureStreamingManager.Update isn’t something I’ve seen. Again if you can provide a bug report with a reproduction case then we can investigate.

Sorry I forgot the version! We are currently using 2019.2f10, but I have seen many of these issues as far back as 2018.2.

I will create a minimal repro when I can find the time.

Thanks!

Any news on this issue? We experiencing also large spikes caused by TextureStreaminManager.Update() calls. They mainly occur when the camera moves or quickly rotates.

We are on Unity 2019.3.2f1 HDRP 7.2.1

Is this a play mode performance capture?

Playmode would be slower than on standalone or specific device as the texture mip load in play mode is synchronous rather than async (unless loading from asset bundles, where it would also be async in editor).

You could reduce the number of textures streamed per frame via the Max IO Requests in the quality settings, Unity - Manual: Quality. This would reduce the per frame IO load but would increase latency. I would recommend testing on target platform before altering this value.

I’ve just run a test scene with 2048x2048 DXT5 textures on PC and am not getting noticeable spikes. It will be dependent on the size of the texture you are using and the format.

If you have a reproduction case that could be shared via the “Help”, “Report a bug” button we can look at your example it more detail.

I get some pretty bad stutters/jerks with texture streaming on in one of my cities, turning it off gets rid of it, or lowering io request down to 256 helps quite a bit. Unity 2021.1.13f. I guess there’s no way to avoid this (at default 1024) if its streaming things in? Maybe reducing all the texture quality would help, I have reduced them as far as I can go really without things looking blocky. For now I have turned off all texture streaming in my quality settings.

Hmm maybe running the game on an ssd would mean texture streaming wouldnt jerk.

I’d recommend using the Unity profiler to identify more precisely what is causing the slow frames. Sharing a .data file capture here or including it as part of a bug report could provide more data for us to advise on. If you raise a bug report please mention the bug id here so I can look at the extra detail.

Did you try reducing the IO request setting right down to 1 to confirm this setting will remove the stutters/jerk.

Are you testing on your target device (and what device is it) or in editor in playmode? (as listed above playmode will load immediately so you may see stutters that will not be present on device).

Hello I’m back.

This still happens 4 years on, and on many different projects. No settings seem to fix it.

I am running this project off an M.2 drive, and we don’t have a lot of textures, but I see 600ms frames sometimes, originating from TextureStreamingManager.LoadMipLevels. This genuinely makes testing difficult sometimes.

I have seen this issue across 5+ different computers, at least 8 different projects and basically every unity version for the last few years.

I have tried every combination of streaming settings. (including Max IO Requests to 1)

This test is in editor.

Should we just be completely disabling streaming in editor?

Thanks
Chris

Hi Chris! What version of Unity are you on? I think this stall should be fixed by a new option that’s in 2022.2 - “Load texture data on demand”. That option is documented on this page. If you’re on 2022.2 or higher, could you check to see if you have that option enabled?

2 Likes

Hello :slight_smile:

I just upgraded to 2022.2 and in my initial testing, enabling this option seems to completely solve the problems! I will give it a bigger test on some more projects.

Thank you so much, this is a really great improvement.

Chris

3 Likes