Description

During material compilation we track unique individual virtual texture "stacks" and then create a virtual texture page table for each, along with unique bindings for each page table in the shader code.

The grouping of texture samples into stacks is done by looking for samples that use the same UVs. This allows us to generate a single page table look up for a group of virtual textures that are sampled together. (Think of a set of BaseColor/Normal/Roughness/Height maps). This is an important optimization for a common use case.

However if the same texture/group of textures is sampled twice with a different common set of UVs, we don't go further and de duplicate the two virtual texture stacks. Doing that would reduce the number of page table SRVs that the shader needs to bind which can be important in cases where making many virtual texture samples approaches the limit of SRVs

Steps to Reproduce

Create a material that samples a single virtual texture twice with different UVs.

Look at the generated shader code in the material editor using the Menu:Window/ShaderCode/HLSL Code

Observe that the shader code contains two VT stacks: VIRTUALTEXTURE_PAGETABLE_0 and VIRTUALTEXTURE_PAGETABLE_1

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-214834 in the post.

0
Login to Vote

Backlogged
CreatedMay 13, 2024
UpdatedMay 20, 2024
View Jira Issue