# Render Custom Depth on Nanite enabled not working

**URL:** <https://forums.unrealengine.com/t/render-custom-depth-on-nanite-enabled-not-working/505390>\
**Category:** Rendering\
**Tags:** Post-Processing, custom-depth, unreal-engine, UE5-0, Nanite\
**Created:** [March 9, 2022, 4:25pm UTC](https://forums.unrealengine.com/t/render-custom-depth-on-nanite-enabled-not-working/505390 "2022-03-09T16:25:42Z")\
**Posts on this page:** 1\
**Showing post:** 20

<div class="post-metadata">

**Author:** ![Czero\_69](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Czero\_69](https://forums.unrealengine.com/u/Czero_69)\
**Post date:** [December 22, 2022, 6:06pm UTC](https://forums.unrealengine.com/t/render-custom-depth-on-nanite-enabled-not-working/505390/20 "2022-12-22T18:06:32Z")

</div>

Hello guys,

What is the current status?

As I understand, the [5.1 docs](https://docs.unrealengine.com/5.1/en-US/nanite-virtualized-geometry-in-unreal-engine/) says it is not (yet) supported

> Nanite-enabled meshes do not currently support:
> 
> - Custom depth or stencil

If so, why these tickets says it’s fixed/resolved?

- [Unreal Engine Issues and Bug Tracker (UE-149878)](https://issues.unrealengine.com/issue/UE-149878) says **fixed**
- [Unreal Engine Issues and Bug Tracker (UE-171655)](https://issues.unrealengine.com/issue/UE-171655) says **duplicate - resolved**

possibly related issue (however this one does not mention ‘Nanite’):

- [Unreal Engine Issues and Bug Tracker (UE-163921)](https://issues.unrealengine.com/issue/UE-163921)

I would really have a great usage of writing to stencil buffers globally for entire CitySample demo full of nanite meshes. Copying mesh (and making it no-nanite), using Nanite Pass Switch seems to be a workaround applicable manually only to some small portion of selected actors, but it seems it is not a good way to go globally with a huge scene like that. My usecase is creating a segmentation masks, where I can controll segmentation classes by simple regexes (classes like: pedestrain, car, building, road, sky, traffic\_sign etc.).

Any chance we get this feature implemented in 5.2? Or maybe to get more insights of what needs to be done to make Nanite working with stencils buffer writing. Maybe it is quite easy or moderate difficulty task - so it can be pushed by the community?

---

_[View the full topic](https://forums.unrealengine.com/t/render-custom-depth-on-nanite-enabled-not-working/505390)._
