Best way to make a widget similar to UnrealWidget in game

Hi, our team is trying to make a similar widget to the UnrealWidget to enable the user to translate and rotate objects in game.

We need the widget to stay always on top (doesn’t need to have a different material when occluded), and being shaded would be a bonus.

We have been researching this problem for a while now, here are some approaches that we tried:

  • Using PDI and HitProxies as it is done in UnrealWidget, but we understand that this is only supposed to be used in the editor and isn’t the best way to do it, even performance-wise.
  • Using a translucent material with depth test disabled and with a custom Translucency Sort Priority but that way the rendering order of the axis isn’t always right. See
  • A similar solution to the previous but with a custom World Position Offset on the material, the results were the same.
  • Using the stencil buffer but we are already using it for an object outline effect, so in the middle of the object, the values in the stencil buffer are overrided by the ones of the object because of the z-test. See Does stencil buffer support operations or there is plans to expose them?

It seems that is a feature that few users need and therefore there is no straightforward solution.
What do you recommend as the best way to make this right?

Thanks in advance.

Compositing it like the editor does is probably your only option if you want it to look the same.

Thanks for the answer.

It doesn’t need to look the same, above all we want something that works. Basically we need to render the axes on top of everything else, but avoiding the wrong clipping between them. And, in addition, we need to be able to interact with the axes.

We are trying to avoid changes to the engine, there isn’t any other way “using the engine tools”? Can you answer the question about the stencil buffer? Would be better to create a thread for each question/problem?

Yeah, creating a different thread for each problem is preferred. The same person that gets the ticket assigned can’t necessarily answer all the questions.

Compositing another render target on top of the results exactly like the editor is the only way I know to make this work. There’s no way to just “enable the engine tools”.