Using layers for stencil (alpha) not working when Nanite is enabled?

Hello nice people, thank you for reading this!

I want to render different layers of a scene for compositing using UE5.2.

I am using the technique described by William Fauchner (thank you, William!) and it works fine until I have any object that uses nanite in the scenery. As soon as I have enabled Nanite for an object nothing is rendered anymore. Black frame.

Having a standard Cube attached to layer A and a standard Sphere attached to Layer B, when I render via “Movie Render Queue” and “Deferred Renderring” and add “Layer B” to “Layer Actors”, the sphere on B is rendered fine as long as BOTH the cube and the sphere have switched “Enable Nanite” off. Same happens when using “Path Tracer” for rendering.

Any advice how to deal with that?

Thanks a lot!

1 Like

Did you find a solution for this?
Just figured out that nanite was the issue after several hours of troubleshooting…
Currently just working around it by putting the nanite meshes in a separate sublevel that I hide via level visibility track, but that only works in very few cases of course.

No solution yet, no. But did you succeed with sublevels?

Well, no, like I said, its a workaround that only works for certain situations, for example when the assets on that sublevel aren´t partially obstructed etc.
Would certainly be easier if I could just use stencil layers.

Having the exact same problem here. I have to delete all nanite meshes in order to get my stencil layer to render. This is pretty rough. First, tiled rendering changed making it far less dependable now this. I’m going to report it as a bug if that hasn’t been done already.