Inquiry about using RVT Output and Virtual Texture Samplers in Landscape Materials

Hello,

We are currently using RVT Output in our landscape materials.

Additionally, we plan to use Virtual Texture Samplers for the layer textures, as shown below Image.

However, when we use both RVT Output and VT Samplers simultaneously in a landscape material, Unreal outputs the following error message:

“Virtual Texture samples are not allowed during Runtime Virtual Texture Output.”

By enabling bRelaxRuntimeVirtualTextureRestrictions

, which was introduced in version 5.6.0, we can use both without encountering this error. We do, however, have a couple of questions:

  1. Is it safe to use RVT Output and VT Samplers together in a landscape material with bRelaxRuntimeVirtualTextureRestrictions enabled? Why was this restricted prior to version 5.6.0?
  2. Is there any possibility that the Virtual Texture used by the VT Sampler and the Virtual Texture used by the RVT Output could reference the same memory address, causing issues such as Access Violations? (This is essentially the same question as #1.)

Thank you.

comment relate to bRelaxRuntimeVirtualTextureRestrictions

/**

* Relax restrictions on Runtime Virtual Texture output compilation.

* Normally we give a compilation error whenever a Runtime Virtual Texture Output reads from a Virtual Texture.

* This is because there is no feedback from Runtime Virtual Texture Output passes and no guarantee that Virtual Textures will be ready.

* If allowed then Runtime Virtual Texture pages can contain stale low resolution data that is not evicted until the pages are flushed.

*/

Hey there! The short answer is that we’re still not necessarily recommending the use of VT samplers in an RVT output. We’ve made some headway in reducing some of the issues but not all of them. Right now RHI Validation issues have improved, which is where that flag comes from. There’s still some risk of pages going stale, so you’d want to have continuous updates enabled. BUT the bigger issue, in my mind, is that the RVT pass still doesn’t have a VT feedback pass, so the tiles that get pulled in when the RVT is drawn aren’t guaranteed to be correct.

For the time being, my recommendation is to stick with traditionally-streamed textures when drawing into an RVT.

For other uses of streaming virtual textures, check out my talk Virtualize Everything: Polygons, Shadows, and Textures, Oh My!from Unreal Fest Gold Coast 2024.

First of all, thank you for your kind and quick response.

I have a few follow-up questions:

When you mentioned that “the tiles that get pulled in when the RVT is drawn aren’t guaranteed to be correct,” does this mean that VT Samplers might receive invalid data during RVT Output, or that it could potentially lead to a crash?

Also, when you say “traditionally-streamed textures,” you’re referring to non-VT textures, correct?

Our game is still about two years away from release, and I was wondering if Epic’s long-term goal is to support using VT Samplers together with RVT Output in landscape materials.

Thank you.

Sorry for taking so long to get back to you:

  • This means that VT samplers would receive invalid data during output. I wouldn’t expect a crash on that.
  • Correct on non-VT textures.
  • I’m not aware of any plans to develop a feedback pass for RVT draws at this time.