Search code examples
unreal-engine4depth-buffer

UE4 UMG widget clips through the environment: VR target reticle


I'm creating a VR game, where I'd like to paint a target reticle wherever the user is looking. The reticle is being drawn in world space, and placed at the same depth as the object the user is looking at. (I'm using a line trace to locate the targeted surface and move the reticle to the required depth).

I'm using a UMG widget to paint the reticle in world space.

My issue is that the reticle will occasionally clip through the world. In Unity, I could set up my material shader to paint the reticle over everything else (regardless of relative depth). However, I'm struggling to replicate the same behavior in UE4. I read online that you can set 'Disable Depth Test' on translucent materials, but since my material domain is 'User Interface', I don't believe that is an option.

How should I go about achieving the desired result?


Solution

  • Instead of using UMG: rendering a quad with a reticle texture, then setting 'Disable Depth Test' gives the correct result.