Texture MIP streaming memory budget not respected in Editor

Hi all,

I’m attempting to implement texture MIP streaming in order to save GPU memory not only in a build, but also in the the Editor (including Play mode / Edit mode).

Test setup and base configuration:

  • I have scene that loads with a scene camera and a game view camera positioned so that it overlooks 100s of props and objects in the distance.
  • Texture MIP streaming is configured in Quality settings and Editor settings as per documentation.
  • I’m setting a low memory budget of 512 compared to the actual visible textures in the scene which would account for 3.5GB if all loaded at MIP 0.

Now, when I load the scene in this state, whether in Edit more or Play mode, the entire 3.5 GB of GPU texture memory is uploaded (i.e. loading all MIP 0 and lower to the GPU):

So after much struggle, I figured out that if also setting “Load texture data on demand” to true, it then will behave correctly and upload to the GPU within the memory budget:

However… here’s the problem:

Enabling that checkbox causes corruption of the Volumetric Clouds in HDRP. They will flicker like crazy, as if some buffer(s) is operating at lower resolution than configured (my best guess).

Furthermore, the description of the setting “Load texture data on demand” (Project Settings → Editor → Streaming Settings), does not imply at all that this checkbox is required to make MIP streaming work correctly in Edit/Play mode. It simply mentions loading in an async manner to reduce CPU stalls.

So I’m now stuck with being forced to enable a theoretically unnecessary setting to have MIP streaming working, or having it not working at all in the Editor.

Any ideas for a work-around? Thanks very much, any help is greatly appreciated.

UPDATE

Following on from the previous post, I’ve got some more information.

As I mentioned, using the “Load texture data on demand” checkbox gives much better memory results in the Editor, but it corrupts HDRP Volumetric Clouds causing strange flickering that gets progressively worse the lower the Temporal Accumulation Factor is.

So over the weekend, I wanted to see if this issue is also present in a build. In theory of course it should not be, because “Load texture data on demand” is an Editor related setting for MIP streaming.

So I did a build, and found that textures/materials were randomly missing or corrupted in some way. Terrain for example shows up as black textures. Half the UI textures were invisible.

Eventually I figured out that if you do a build while “Load texture data on demand” is active, it corrupts the build in this way. Even if you switch off that checkbox, then do the build, it’s still a mess. The only way to do a build without corrupted textures, is to make sure the checkbox is off, then reload the Editor - i.e. if the checkbox was on at any point during the session, it will corrupt the build.

Hope someone from Unity has some insight.

For now, I will just stay far away from that checkbox.