How do I set up a 3D UI interface which appears in front of the background but behind certain foreground elements?

I am making 3d UI menu in the front of the character like the first image
But, when the slots in the UI menu meet the other object, it is not shown.
I want to make it like image 2 .
and I tried to find a way to make it and I found that I could use Render Custom Depth for it.
But, it doesn’t work well…
I didn’t put anything in the material . is that a problem?
or how can I make it work ?


20843-

Enable Disable Depth Test in the material properties and it will render on top of everything.

Hi. Thanks for the answer.
I know, Disable Depth Test makes it rendered on top of everything.
But, it will hide character as well… I hope to make it like the second image…

Thanks!

In that case you’ll need to look into post process materials. Check out this thread to learn more about making use of custom depth: [Tutorial] The many uses of Custom Depth in Unreal 4 - Community & Industry Discussion - Unreal Engine Forums

Thanks…but, I already read the article…and still having a problem…

:frowning:

Hey gomderbar -

Have you tried disabling the Depth Test on your HUD and then making your Character Render in Custom Depth the use a post process material to calculate a LERP using the Custom Depth Subtract (10000) divide by (1500) clamped from 0 to 1 as the alpha?

Thank You

Eric Ketchum

I will try out! Thanks!@

You could use “CustomDepth Stencil Value” on your character and set it to 1. After that, just use something like this on your UI Material.

192653-material.png

Your character will write 1 to the Stencil (CustomStencil), so your UI Material will check if the value is 1, the opacity should be 0. 1 - Clamp ( 1, 0, CustomStencil ). It should work without the Clamp I guess.