# Custom Depth Stencil Value on foliage

**URL:** <https://forums.unrealengine.com/t/custom-depth-stencil-value-on-foliage/370174>\
**Category:** World Creation\
**Tags:** custom-depth, unreal-engine, Foliage, question\
**Created:** [September 12, 2016, 8:58am UTC](https://forums.unrealengine.com/t/custom-depth-stencil-value-on-foliage/370174 "2016-09-12T08:58:56Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![ZoltanE](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ZoltanE](https://forums.unrealengine.com/u/ZoltanE)\
**Post date:** [September 12, 2016, 8:58am UTC](https://forums.unrealengine.com/t/custom-depth-stencil-value-on-foliage/370174/1 "2016-09-12T08:58:56Z")

</div>

Is there any way to set Custom Depth Stencil Value for foliage?

---

<div class="post-metadata">

**Author:** ![Haoris](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Haoris](https://forums.unrealengine.com/u/Haoris)\
**Post date:** [September 21, 2016, 4:03am UTC](https://forums.unrealengine.com/t/custom-depth-stencil-value-on-foliage/370174/2 "2016-09-21T04:03:22Z")

</div>

Bump, I need this too

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_6e7b421a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_6e7b421a](https://forums.unrealengine.com/u/anonymous_user_6e7b421a)\
**Post date:** [September 21, 2016, 8:50pm UTC](https://forums.unrealengine.com/t/custom-depth-stencil-value-on-foliage/370174/3 "2016-09-21T20:50:34Z")

</div>

Hey ZoltanE,

Not that I need a super in depth explanation, but if you could elaborate on why you need this option exposed to foliage, and how you plan on implementing this in your own project I can enter a feature request to have this added.

Thank you,

---

<div class="post-metadata">

**Author:** ![ZoltanE](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ZoltanE](https://forums.unrealengine.com/u/ZoltanE)\
**Post date:** [September 24, 2016, 2:11pm UTC](https://forums.unrealengine.com/t/custom-depth-stencil-value-on-foliage/370174/4 "2016-09-24T14:11:54Z")

</div>

We’re classifying entities on the level with different Custom Depth Stencil values: 0 = background, 1 = road, 2 = buildings, 3 = plants and so on. The related buffer is later saved to disk and used to teach an AI.

Certain plant types are better placed as foliage but right now we can’t mark them the same way as hand placed plants.

---

<div class="post-metadata">

**Author:** ![JamesMaiden](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@JamesMaiden](https://forums.unrealengine.com/u/JamesMaiden)\
**Post date:** [September 27, 2016, 10:52am UTC](https://forums.unrealengine.com/t/custom-depth-stencil-value-on-foliage/370174/5 "2016-09-27T10:52:15Z")

</div>

I’d like to bump this as I need this in order to remove foliage from an occlusion mask using a stencil and customdepth

---

<div class="post-metadata">

**Author:** ![NC3D](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@NC3D](https://forums.unrealengine.com/u/NC3D)\
**Post date:** [March 19, 2019, 9:03pm UTC](https://forums.unrealengine.com/t/custom-depth-stencil-value-on-foliage/370174/6 "2019-03-19T21:03:58Z")

</div>

Bump!  
We are trying to implement non-photoreal styles and we also need stencils on our foliage (and sky, water, roads and buildings)

---

<div class="post-metadata">

**Author:** ![pravinjaisawal](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@pravinjaisawal](https://forums.unrealengine.com/u/pravinjaisawal)\
**Post date:** [January 17, 2023, 1:30pm UTC](https://forums.unrealengine.com/t/custom-depth-stencil-value-on-foliage/370174/7 "2023-01-17T13:30:58Z")

</div>

Hi ZoltanE, did you find the way to do it?

---

<div class="post-metadata">

**Author:** ![ZoltanE](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ZoltanE](https://forums.unrealengine.com/u/ZoltanE)\
**Post date:** [January 21, 2023, 4:27pm UTC](https://forums.unrealengine.com/t/custom-depth-stencil-value-on-foliage/370174/8 "2023-01-21T16:27:44Z")

</div>

The programmers had to modify the engine… :\

---

<div class="post-metadata">

**Author:** ![Bugzi](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Bugzi](https://forums.unrealengine.com/u/Bugzi)\
**Post date:** [February 18, 2024, 4:34pm UTC](https://forums.unrealengine.com/t/custom-depth-stencil-value-on-foliage/370174/9 "2024-02-18T16:34:32Z")

</div>

I found how to do it,

Go into Selection Mode, Select your Instanced Folliage, Select all Foliage (or 1 by 1), Search “pth” in your Details tab, and voilà! the render CustomDepth Pass is there.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/a/3/da3e6f70a459eb5aeb4b623ee3bc9eed73f40b3c.jpeg)

---

<div class="post-metadata">

**Author:** ![Rhifted](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Rhifted](https://forums.unrealengine.com/u/Rhifted)\
**Post date:** [July 12, 2024, 3:46pm UTC](https://forums.unrealengine.com/t/custom-depth-stencil-value-on-foliage/370174/10 "2024-07-12T15:46:03Z")

</div>

You’re a lifesaver, this worked! Thanks so much!

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [September 25, 2024, 10:12am UTC](https://forums.unrealengine.com/t/custom-depth-stencil-value-on-foliage/370174/11 "2024-09-25T10:12:12Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
