If we connect a virtual texture to the opacity mask output of a material the material will fail to compile. Currently this is expected because allowing it could cause problems such as:

  • No virtual texture feedback in the shadow pass causing incorrectly cached shadows.
  • No virtual texture feedback from masked pixels could cause virtual texture not to reach a good mip level.

If we connect only a regular texture we don't expect a problem.

However if the opacity mask uses a regular texture connected via MakeMaterialAttributes and BreakMaterialAttributes nodes and any virtual texture is connected to other properties in the MakeMaterialAttibutes then we still see a compile error.

It seems that the compilation validation logic is checking all texture samples connected to MakeMaterialAttributes instead of just the ones connected through the OpacityMask pin.

Steps to Reproduce

In a project where Virtual Textures are enabled, create a material like below.
[Link Removed]

Note that the texture connected to the BaseColor pin is a virtual texture, but the one connected to the OpacityMask pin is a regular texture.
Observe the material compilation error: "Sampling a virtual texture is currently not supported when connected to the Opacity Mask material attribute."
The expected behavior is for the material to compile.

Have Comments or More Details?

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

Login to Vote

ComponentUE - Graphics Features
Affects Versions5.0
Target Fix5.1
Fix Commit20486016
Main Commit20486016
CreatedJun 2, 2022
ResolvedJun 3, 2022
UpdatedJul 11, 2022
View Jira Issue