Description

Some Material Attribute blends in Material Layer Blends can cause Virtual Texture samples to be duplicated in HLSL. This can be avoided by sampling the Virtual Texture in the Parent Material, and passing it through the layers into the blend.

Steps to Reproduce

1. Download the attached test project and open
2. Open the Material Instance "/Game/MI_Expensive_Blend"
3. Observe that its "VT Lookups (Est.)" is 13
4. Observe that the HLSL will call `ProcessMaterialVirtualColorTextureLookup(...)` many times in `CalcPixelMaterialInputs(...)`. (around lines 4194, 4248)
5. Open the Material Instance "/Game/MI_Cheap_Blend"
6. Observe that its "VT Lookups (Est.)" is 3
7. Observe that the HLSL will call `ProcessMaterialVirtualColorTextureLookup(...)` once in `CalcPixelMaterialInputs(...)` and use the output for all blends. (around lines 4194)
8. Open the two Material Layer Blends "/Game/SupportAssets/MLB_VT_Cheap" and "/Game/SupportAssets/MLB_VT_Expensive".
9. Observe the difference in where they fetch the VT mask. The Expensive blend fetches the mask in a parameter in the blend itself, while the Cheap blend fetches the mask from the Parent Material.

Have Comments or More Details?

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

1
Login to Vote

Backlogged
CreatedMar 14, 2025
UpdatedMar 17, 2025
View Jira Issue