Virtual samplers not accepting virtual textures with material layers

On the project, look for MI_Opaque_Weather, on the texture maps section, there are 3 textures to set, they accept virtual textures only and its fine, if I create any instance from this material, for some reason, they do not let me set virtual textures, only regular ones. I need to convert the textures, set them, and then convert back, which makes no sense.

Steps to Reproduce
Find the MI_Opaque_Weather and create an instance of it, the texture sampler won’t work the same as the parent

Hi Pedro,

Thank you for providing a repro project. I have reproduced the issue using it, and I am now trying to construct a minimal repro and do a preliminary investigation on the cause of the problem. The absolute minimal test project I attempted did not repro that behavior, but I’m still making experiments on what exactly might be triggering it.

Hi Pedro,

Ok, I think I narrowed down the issue. It seems that the type (regular or virtual) of the textures that appear in the asset picker on the Layer Parameters tab is actually tied to the “Default Layers” that were setup in the “Material Attribute Layers” node in the parent material. In your case, please try this:

- Edit the parent material “M_OpaqueBase”

- Select the “Material Atribute Layers” node

- In the Details Panel, under Default Layers -- Background -- Layer Asset, click the asset picker and select “Clear” (avoid clicking the “reset to default” buttons, since they caused the editor to crash in my tests)

- Apply and save the parent material

From this point onwards, I believe “MI_Opaque_Weather” and other material instances on the hierarchy of “M_OpaqueBase” should display both kinds of textures (Regular and Virtual) on their texture asset pickers on the Layer Parameters tab. Please let me know if this helps!

In any case, I will file a couple of internal bug reports here, one for that odd behavior and another for the crash when clicking the “reset to default” buttons. I’ll get back to you again with the tracking numbers for them.

Best regards,

Vitor

Hi again Pedro,

After examining the repro project you provided more closely, I noticed that you are attempting to select the sampler type (regular or virtual) of those textures by using Static Switch nodes. However, I don’t believe the engine supports this usage of Texture Parameters. In my tests here, I got several odd behaviors when attempting to do that. I strongly recommend you use different parameter names for different sampler types, such as “RegularColorTexture” and “VirtualColorTexture”, which also allows you to keep the Static Switch selector between them. This will probably make your materials behave better.

For now, I have filed a bug report for the crash I mentioned earlier. Here’s the bug tracker link, which should become accessible once the engine devs mark it as public: UE-304961. And I’ll let you know if I can get to a minimal repro for that asset picker behavior.

Best regards,

Vitor