Hello,
I decided to change the question and description of the problem, the original is attached further below.
After investigating some more I discovered that certain settings make masked materials always invisible, in the editor and during PIE. I’m not sure if that’s deliberate. Steps to recreate the issue:
- Create a new blank project.
- Create a new material, make it masked and set Opacity Mask value to 1.
- Add static mesh with this material on the level.
- Set “DBuffer Decals” to False (Project Settings / Rendering).
- Set “Mask material only in early Z-pass” to True (Project Settings / Rendering).
Static mesh will disappear after two last steps but will still cast shadow.
Original post:
Early Z-pass makes masked meshes spawned at runtime invisible
Hello,
Playing with particle effects I noticed masked material set to 0 opacity generates as much shader complexity as translucent one set to 0 opacity. So I activated “Mask material only in early Z-pass” in Project Settings and set Early Z-pass mode to “Opaque and masked meshes”, as that was the only set of options that changed this behaviour to what I would expect (which is strange by the way, shouldn’t the editor sort out such issues with “Decide automatically” mode? I mean, what’s the point of masked materials otherwise?).
After that particles work fine, but every mesh with masked material I create in Construction Script or during runtime is invisible.