# Custom Depth Stencil index isnt respected.

**URL:** <https://forums.unrealengine.com/t/custom-depth-stencil-index-isnt-respected/783306>\
**Category:** Rendering\
**Tags:** Post-Processing, stencil, depth, unreal-engine, Rendering, question\
**Created:** [March 3, 2023, 11:23pm UTC](https://forums.unrealengine.com/t/custom-depth-stencil-index-isnt-respected/783306 "2023-03-03T23:23:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Suundumused](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/suundumused/32/599389_2.png) [@Suundumused](https://forums.unrealengine.com/u/Suundumused)\
**Post date:** [March 3, 2023, 11:23pm UTC](https://forums.unrealengine.com/t/custom-depth-stencil-index-isnt-respected/783306/1 "2023-03-03T23:23:45Z")

</div>

I have a problem, I created a post processing material to see objects through the wall, so I set the material in position 3 of the post processing volume, the meshes that I don’t want to see through the wall I left in Custom Stencil to 1, which are a affected by another material from position 1, but post processing material ID at 3 is affecting meshes with stancil index 1. How do I filter Post Processing Material by Stencil ID on meshes?  
 ![Captura de tela 2023-03-03 201621](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/7/1/a7133b02f132998859cb3dd9d799e4941f2b4c64.png)

 ![Captura de tela 2023-03-03 202513](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/b/9/0b9d411f2c1dd30c0bf82306c8125fdfccd6b70c.png)

---

<div class="post-metadata">

**Author:** ![Suundumused](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/suundumused/32/599389_2.png) [@Suundumused](https://forums.unrealengine.com/u/Suundumused)\
**Post date:** [March 3, 2023, 11:53pm UTC](https://forums.unrealengine.com/t/custom-depth-stencil-index-isnt-respected/783306/2 "2023-03-03T23:53:05Z")

</div>

I found it by enabling Stencil Test, constraining the ID to equal and setting the ID value which I used in the mesh.  
 ![sol](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/6/5/6651d87ab4afd537c05006beb8b4884d788529f9.png)
