5.1 Nanite not able to write to stencil buffers

Hello,

what is the status for this issue ticket? Unreal Engine Issues and Bug Tracker (UE-171655) says duplicate - resolved

  • It says it is a duplicate, but duplicate to what issue exactly (no link) ?
  • Is it going to be fixed in 5.2 release?
  • Is it maybe already fixed in ue5-main branch ?

related thread in Epic Forum.

thank you!

There is a commit for Add ability to render Nanite in the custom depth stencil pass. https://github.com/EpicGames/UnrealEngine/commit/38657d35af200c5cb1095

1 Like

Thank you for quick replay! I will built ue5-main and will check does nanite writing to stencil buffers work for me. If yes, we can mark your answer as a solution.

Did that not make it into the official 5.2 release?

I just came upon this after a bunch of troubleshooting, because stencil layers rendered only black in my level.
After setting the nanite actors to hidden in game OR disabling nanite on them, stencil layers rendered fine.

1 Like

We’re having the same exact issue. Turning nanite off fixed it, but assets look really bad at that point. Is there any other work-around not involving turning nanite off??

Sadly, stencil layers and nanite still don´t seem to work with 5.2.
Our workaround is:

  1. Try to put all assets you may want to separate on separate sublevels.
  2. Animate everything in your main sequence.
  3. Nest the main sequence as a subsequence/shot into another sequence (we add a prefix “RP_” for “Renderpass”.
  4. Add Level visibility track in the RP sequence.
  5. Use the visibility tracks for the sublevels to turn off all assets not wanted in a specific render pass, or needed as an extra layer (for color correction or fade in in post for example).
  6. Create as many RP sequences as you need and add them all to a movie renderqueue, then save the Movie renderqueue.
  7. Anytime you need to change the main sequence, it will automatically update in the RP sequences.

This is only a workaround, if you can easily separate assets like that and if you don´t need more complex compositing, as assets not rendered due to their visibility set will of course also not cast shadows etc.

You could also create a postprocesses material that makes everything invisible, that is NOT set to a specific stencil channel, but that has its own problems.

2 Likes

Thank you very much!