How can I use Streaming Virtual Texture in projects with MANY/MASSIVE textures without blurry them

Hi Everyone. I was recently enabling Streaming Virtual Texture in my project which has about 20k textures(UI textures not included) in it. However, these virtual textures got blurred in runtime. More informations are as follows:

  1. When typing r.VT.Residency.Notify 1 in console, There willl be yellow colored warning information saying that “VT Pool [DXT1] is oversubscribed. Setting MipBias 0”;
  2. When typing r.VT.Verbose 1 in console, there will be many output log says that “Space 0, vAddr 0@0 is not allocated to any AllocatedVT but was still requested” and “VT dropped -XXX loaded requests”. “-XXX” is a negative integer number.
  3. Camera is not moving when I try the above operations.
  4. I have tried to adjust the fixed pool and transient pool settings in editor and packaged builds but still get a blurred result.
  5. I did not change the Tile Size Setting of Virtual Texture in Project Settings. So I am still using the default setting.

So here are my questions:

  1. Are there any documentations or slides which talk about the insides of Streaming Virtual Texturing of Unreal Engine.
  2. How about increase the Tile Size Setting, cause I feel like the virtual page might not be enough.

It will be a great help if anyone know something about this. Many Thanks!!!

I think you might be having texture streaming pool error, which would be visible written red on your viewport.

Most probably something like this :

If yes then type “r.Streaming.PoolSize” in your console command and by default it should be 1000 if you’ve not changed anything, then increase it up to 3000 or 4000 but it will increase the use of your performance.

@malik_217 Hi, Thanks for your reply. So I’ve tried this already, but still not working. What you mentioned will work if I use regular texture(not Streaming Virtual Texture) because before I enable VTs for my textures, they will get blurred if “r.Streaming.PoolSize” is small. So Streaming VTs has different pools I guess.

Maybe try lowering resolution of your textures, like you might be having 4k or 8k textures for many tiny things in which it won’t matter that if it is 2k or 4k.

So try lowering those, that might help.

I wrote this for offline rendering but it could be helpful here.

r.Streaming.PoolSize will not affect Virtual Textures, as they have their own pool.

@comlys Great Post, THANK U! I managed to fix my issue by change the virtual texture tile size from the default 128x128 to 64x64 and repackage my project, the blurry textures are gone. Now I’ve come to another problem. So I understand that there comes a “Virtual Texture Tax” but I wonder if there is some way which makes this “Tax” low and gives much more quicker responses when camera moves around the scene. Meaning that the engine can streaming as quickly as possible when camera zooming while keeping relatively low performance costs. I will continue digging the CVars and other docs.

I would make sure that the pool size is configured as appropriately as possible. That should hopefully allow you to be optimized with any possible re-processing.

Hi @comlys , Are there possibilities creating multiple physical pools for a single format. For DXT1 there is an upper bound that only one single 16k physical texture can be used(about 128Mib). I’ve noticed that there is a CVar “r.VT.SplitPhysicalPoolSize” that can split into multiple physical pools. But it seems to be related to page table memory optimization and will not create multiple 128Mib DXT1 physical pools. So is there any configuration that I can refer to? Many Thanks!

Hi @comlys , there is another problem when using VTs in MRQ. If change the tile size from 128 to 64(since the VT pool is oversubscribed), there are chances that the MRQ will stall forever(and I did not setting any VT CVars). I’ve used Unreal Insights to profile the stall rease and it shows that FVirtualTextureSystem::SubmitRequests is taking up infinity time. Also in packaged builds, it seems ok roaming around the scene if change tile size to 64. But if modify some updating related VT CVars, It will also get stuck. Change the VT feedback factor from 1(MRQ default) to larger value will make the stall chance lower but not 100%.

Are there possibilities creating multiple physical pools for a single format

Not that I am aware of unfortunately.

If change the tile size from 128 to 64(since the VT pool is oversubscribed), there are chances that the MRQ will stall forever(and I did not setting any VT CVars). I’ve used Unreal Insights to profile the stall rease and it shows that FVirtualTextureSystem::SubmitRequests is taking up infinity time.

I have not seen this before. Do you have a repro you could share. Does it complain about anything in the logs?

(post deleted by author)

Hi @comlys ,I can’t provide you the repo as I have no access to public net but I will provide as many informations as possible. First a pic of Unreal Insights trace is as follows:

  1. The Game Thread is stucked getting the MRQ preview texture;
  2. The Render Thread is also stucked;
  3. The Task System Foreground Worker Thread is stucked submitting virtual texture requests.
    The infinity part of the trace file will not show up until I kill the editor process in task manager.

It seems when using offscreen rendering with MRQ will fix this issues.

And in the log files, there will be GPU timeout warning right before editor got stuck. An example will be:

“LogD3D12RHI: Warning: GPU timeout: A payload (0x**********) on the [0x********, Compute] has not complete after X seconds.”