MSAA breaks post process material that compares scene depth and custom depth

I’m not sure whether this is an issue that’s just inherent to MSAA or not, but I can’t seem to find any proper information on this issue.

  1. Download 's outline shader. Multi-color Outline Post Process - Tom Looman

  2. Enable Forward Renderer

  3. Set custom depth stencil pass to enabled with stencil

  4. Create a new material with a base color input of 0.1

  5. Create an unbound post process volume using the post process material.

  6. Create some spheres and place them in a similar manner to what’s shown below. Enable custom depth on them and set their custom depth stencil value to 254. Apply the material we made previously to them to improve visibilty of the effect.

  7. Observe the effect rendering correctly

  1. Switch to MSAA with atleast 2 samples.

  2. The effect no longer works correctly.

Hey,

Could you provide a sample project that shows the behavior you’re seeing. When following your reproduction steps, I don’t see any difference in the spheres between steps 7 and 9. Additionally, this issue seems to be mentioned at the bottom of the download page you linked. As mentioned there, can you try replacing the occlusion test with the setup provided ?

Hi . Here is the project.

https://www.dropbox.com/s/f5b0xfzi5yi65d9/MSAADepth.zip?dl=0

Just toggle between MSAA and FXAA/TAA, and the issue should appear.

The posts from the material’s page are mine, as is the workaround which I found after I made this post. However the workaround is noticeably less accurate and doesn’t fully solve the issue.

Basically the issue seems to stem from this:

This is a screenshot taken from another project. One under MSAA, the other under FXAA, while using the post process material below. The depth comparison produces entirely different (incorrect) results under MSAA.

Hey-

Sorry for the delayed response. I have entered a report based on the sample project you provided: Unreal Engine Issues and Bug Tracker (UE-49851) . You can track the report’s status as the issue is reviewed by our development staff. Please be aware that this issue may not be prioritized or fixed soon.

Cheers

I too am running into this, but noticed the issue is flagged as “won’t fix.”

Is there an alternate approach we can rely on or is there any insight into why this will not be fixed?

Would you mind sharing your workaround? I’m running into this as well but your project’s dropbox link has expired.

https://

That was how I solved it. It’s not as accurate, but for my needs it didn’t need to be.

Ah, thanks for posting! I need a little more accuracy, but hopefully your post will help someone else in a similar situation.

This picture is not avaiable anymore. Can you repost your solution ? Thanks in Advance

1 Like

Any update on this? We’re also running into this issue with MSAA and scenedepth.

Any update on this? We’re also running into this issue with MSAA and scenedepth.

Any update on this? We are running into this issue and wasted tons of time just to find it flagged “Won’t Fix”

Yes, what is the correct solution then if this is not something that will be fixed?

Can confirm this workaround worked with mobile MSAA for me.

+1 I would kindly appreciate an brief explanation on why this is marked as “won’t fix.” And ideally any information regarding an alternative approach for using MSAA and custom depth would be great.