Unexpected References in Layered Material Instances

Hello everyone,

I’ve encountered a very weird and unexpected behavior with layered materials in Unreal Engine 5.4.3. Instances of these materials may keep references to master material sub-assets such as material functions and material parameter collections, even after they were removed from the parent material.

Steps to Reproduce:

  1. Create a master material with a layered setup.

  2. Insert a material function and a parameter from a material parameter collection into the graph.

  3. Add some default layers to MaterialAttribute Layers.
    image

  4. Create an instance of the material, then check references in the Reference Viewer. The only reference should be the parent master material, which is correct.

  5. Go to the material layer instance and press the unlink button on one of the layers.

  6. Check references again. The instance now contains references to the material parameter collection and material function, which is already inconvenient and undesired behavior.

  7. Remove the material parameter collection and material function from the master material graph and save it.

  8. Check the references again. The references to the assets that were just removed still persist.

It seems like a pure bug, and as we extensively use layered materials, we are facing significant issues:

  • Dependency graphs of our materials contain dozens of material function references, including default Unreal ones.

  • Restructuring material function and parameter collection resources and fixing redirectors affect not only master materials but also all child materials.

  • Fixing redirectors may cause some unexpected shader compilation crashes, which become a serious problem for us.

This is just one way we’ve found to break the system, and it appears there may be other ways as well. While the layered material system offers powerful features, it still feels buggy, fragile, and incomplete. This has led to significant issues in our production environment, making it challenging to manage materials effectively.

Has anyone else experienced something like this?
Is there a known workaround?
Is there an existing bug report for this issue?

Any insights or advice would be greatly appreciated!

Thank you.