# Why i cant use "Render after DOF" when i use MSAA4X???

**URL:** <https://forums.unrealengine.com/t/why-i-cant-use-render-after-dof-when-i-use-msaa4x/690388>\
**Category:** C++\
**Tags:** translucent, msaa, unreal-engine\
**Created:** [November 14, 2022, 1:57pm UTC](https://forums.unrealengine.com/t/why-i-cant-use-render-after-dof-when-i-use-msaa4x/690388 "2022-11-14T13:57:25Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Liz\_0215](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Liz\_0215](https://forums.unrealengine.com/u/Liz_0215)\
**Post date:** [November 14, 2022, 1:57pm UTC](https://forums.unrealengine.com/t/why-i-cant-use-render-after-dof-when-i-use-msaa4x/690388/1 "2022-11-14T13:57:25Z")

</div>

i found this code

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/9/2/8927a7bdd6288ff4cb26f56e428b310fe8935d78.png)  
so,  
i dont know why “on \<= ES3\_1 separate translucency requires HDR on and MSAA off”  
and whats the relation between “Render after DOF” and “MSAA”

Please

---

<div class="post-metadata">

**Author:** ![FIHOTCOOL](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@FIHOTCOOL](https://forums.unrealengine.com/u/FIHOTCOOL)\
**Post date:** [November 15, 2022, 2:35am UTC](https://forums.unrealengine.com/t/why-i-cant-use-render-after-dof-when-i-use-msaa4x/690388/2 "2022-11-15T02:35:56Z")

</div>

because you can’t resolve depth with MSAA on most OpenGL ES 3.1 devices. you can render opaque and masked objects with an additional texture with MSAA on, and end pass after rendering opaque and masked objects, then start a separated pass with no-MSAA SceneColor and no-MSAA SceneDepth to render translucent objects, at the beginning of the translucent pass use resolved additional scene color texture as input, draw a full screen rect using a shader with SV\_DEPTH and SV\_TARGET output, and output RGB and A Chanel witch contains the device depth. remember the SceneDepth is not MemoryLess, and the depth action in the translucent pass need to be DontLoad\_Store.  
Now you can remove (!bMobileMsaa) condition, render after DoF pass will just work fine!

It may increase your gpu bandwidth, I don’t recommended it. Turn off MSAA and use software anti-alising may be a better solution.

---

<div class="post-metadata">

**Author:** ![Liz\_0215](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Liz\_0215](https://forums.unrealengine.com/u/Liz_0215)\
**Post date:** [November 16, 2022, 2:45am UTC](https://forums.unrealengine.com/t/why-i-cant-use-render-after-dof-when-i-use-msaa4x/690388/3 "2022-11-16T02:45:06Z")

</div>

thansk，i know why MSAA cant use the SceneDpeth on \<= ES3\_1 ,  
this means that translucent cant be rendered  
in fact, if somebody use MSAA that he must create a cumstom depth

---

<div class="post-metadata">

**Author:** ![Liz\_0215](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Liz\_0215](https://forums.unrealengine.com/u/Liz_0215)\
**Post date:** [November 16, 2022, 8:13am UTC](https://forums.unrealengine.com/t/why-i-cant-use-render-after-dof-when-i-use-msaa4x/690388/4 "2022-11-16T08:13:18Z")

</div>

wait…  
translucent no need scene depth texture because no write depth  
so?i dont know why msaa can effect rendering translucent

---

<div class="post-metadata">

**Author:** ![PresumptivePanda](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/presumptivepanda/32/1194593_2.png) [@PresumptivePanda](https://forums.unrealengine.com/u/PresumptivePanda)\
**Post date:** [November 24, 2022, 11:30pm UTC](https://forums.unrealengine.com/t/why-i-cant-use-render-after-dof-when-i-use-msaa4x/690388/5 "2022-11-24T23:30:40Z")

</div>

This topic has been moved from **International** to **Programming & Scripting: C++**.

When posting, please review the categories to ensure your topic is posted in the most relevant space. Hopefully, this category change will help to get a solution to your question.

In the meantime, good luck and happy developing! 🙂

---

<div class="post-metadata">

**Author:** ![FIHOTCOOL](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@FIHOTCOOL](https://forums.unrealengine.com/u/FIHOTCOOL)\
**Post date:** [November 28, 2022, 7:10am UTC](https://forums.unrealengine.com/t/why-i-cant-use-render-after-dof-when-i-use-msaa4x/690388/6 "2022-11-28T07:10:59Z")

</div>

translucent DO need scene depth texture, they usually don’t WRITE depth, but they need do depth-test.
