Thanks for the note. I wasn’t aware of the SM6 setting relevance, and I turned it on in my project. UE5.1 Preview 1 showed at least what I was waiting for, so I would like to share the configurations that I tried.
-
I created a new project using a template from UE 5.1 Preview 1. I used the Vehicle template. There is no specific reason though.
-
I changed two project settings: SM6 and Custom Depth-Stencil Pass
- I placed a static mesh from Content Browser. The static mesh that I picked up didn’t have nanite enabled, so I enabled it. Then, I changed two settings of the instantiated static mesh by choosing it from the viewport: enabling Render CustomDepth Pass and giving 2 (arbitrary number) to CustomDepth Stencil Value
- Finally, I applied CustomStencil to Post-Process Materials in PostProcessVolume. The viewport showed the CustomStencil value and the static mesh has nanite on.
When I did the same steps in UE5.0.3, the custom stencil wasn’t displayed. Having said that, this is a preview supposed to be unstable, and the configuration space of Unreal Engine is huge in general. So, I am not confident that what I did here is directly relevant to what you are looking for. I hope this posting still helps though.