# Custom stencil broken for mobile in 4.21?

**URL:** <https://forums.unrealengine.com/t/custom-stencil-broken-for-mobile-in-4-21/437616>\
**Category:** Rendering\
**Tags:** Mobile, stencil, unreal-engine, Rendering, question\
**Created:** [November 14, 2018, 3:41pm UTC](https://forums.unrealengine.com/t/custom-stencil-broken-for-mobile-in-4-21/437616 "2018-11-14T15:41:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_58fb0f69](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_58fb0f69](https://forums.unrealengine.com/u/anonymous_user_58fb0f69)\
**Post date:** [November 14, 2018, 3:41pm UTC](https://forums.unrealengine.com/t/custom-stencil-broken-for-mobile-in-4-21/437616/1 "2018-11-14T15:41:47Z")

</div>

Has there been any changes in 4.21 that require extra steps in order to get custom stencil to work for mobile, or is this a bug? Porting a project from 4.20 that had a post-process material using custom stencil stopped working in 4.21. I also created a 4.21 blank project to test this and got same results: SceneTexture:CustomStencil outputs a color value of zero instead of the custom value assigned to the object. This happens both when tested in editor with Feature Level ES3\_1 and also when running on an iOS device. Feature Level Shader Model 5 works fine.

Post process material used:

 ![259350-customstencilmaterial.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/2/4/c2454221d4ec4beade054ae20de49ff34aed3a1f.png)

Feature Level SM5 (works fine):

 ![259361-customstencildesktop.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/e/a/3ea729add61674dbfae50d4c4a0da3072464785d.png)

][3]

Feature Level ES3\_1 (doesn’t work):

 ![259362-customstenciles31.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/e/4/4e4fdf8b9b0e912c8588392f60836056ac353b41.png)

Same setup as above but in 4.20 and Feature Level ES3\_1 (works fine):

 ![259363-customstenciles31-4-20.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/c/2/cc2971695b07ff4e89c041060a0ee959e41f0301.png)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_58fb0f69](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_58fb0f69](https://forums.unrealengine.com/u/anonymous_user_58fb0f69)\
**Post date:** [November 14, 2018, 6:41pm UTC](https://forums.unrealengine.com/t/custom-stencil-broken-for-mobile-in-4-21/437616/2 "2018-11-14T18:41:31Z")

</div>

This has been identified as a bug/regresion and a ticket has been created by Epic’s staff: [Unreal Engine Issues and Bug Tracker (UE-66502)](https://issues.unrealengine.com/issue/UE-66502)
