# Why my pass can not write Scene Depth?

**URL:** <https://forums.unrealengine.com/t/why-my-pass-can-not-write-scene-depth/651483>\
**Category:** Rendering\
**Tags:** unreal-engine, UE5-0, question, Render-Passes\
**Created:** [September 19, 2022, 3:55am UTC](https://forums.unrealengine.com/t/why-my-pass-can-not-write-scene-depth/651483 "2022-09-19T03:55:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![\_Z11](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@\_Z11](https://forums.unrealengine.com/u/_Z11)\
**Post date:** [September 19, 2022, 3:55am UTC](https://forums.unrealengine.com/t/why-my-pass-can-not-write-scene-depth/651483/1 "2022-09-19T03:55:19Z")

</div>

I set the DepthStencilState as\<true, CF\_DepthNearOrEqual\>，and bind my pass RenderTargets.DepthStencil = BasePassRenderTargets.DepthStencil . Use RDG add MyPass into BasePass to Draw.Finally color buffer，normal buffer … every buffer is correct，except SenceDepth.I don’t know what I did less or did wrong.  
Sorry for my bad english.I struggled with this problem for many days，I was expecting some help here.  
Thank you.

---

<div class="post-metadata">

**Author:** ![3dRaven](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/3draven/32/906552_2.png) [@3dRaven](https://forums.unrealengine.com/u/3dRaven)\
**Post date:** [September 19, 2022, 2:07pm UTC](https://forums.unrealengine.com/t/why-my-pass-can-not-write-scene-depth/651483/2 "2022-09-19T14:07:51Z")

</div>

Are you using this for a scene post process material?  
Don’t forget to allow custom depth writes in the post process material

 ![customWrite](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/d/1/5d1831d8fa3f18a0262dcdf31bcf81d5c7121155.jpeg)

---

<div class="post-metadata">

**Author:** ![\_Z11](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@\_Z11](https://forums.unrealengine.com/u/_Z11)\
**Post date:** [September 20, 2022, 2:29am UTC](https://forums.unrealengine.com/t/why-my-pass-can-not-write-scene-depth/651483/3 "2022-09-20T02:29:18Z")

</div>

Thanks for your reply. It is using for mesh material.I found I made a mistake:  
directly use BasePassRenderTargets.DepthStencil，Although it with DepthPass bind to the same texture,but But thay bind differently DepthStencilAccess.Re-doing the correct binding solved my problem.
