Rendering Debug Lines on top of geometry (depth bias)

I am trying to draw debug lines on top of geometry. So that I can render a line through the geometry without having to go intro Wireframe mode to see it fully.

It appears that DepthBias is not accessible with the standard DrawDebugLine interface of the engine (although the lines that render DO have this as an optional param, it would be great if this param got exposed all the way up to DrawDebugLine().

Secondly using DepthPriorityGroup on the line seems to do nothing at all. The line is pushed into a ForegroundLineBatcher (which means it can’t be persisted which is an unfortunate draw back) and it doesn’t get drawn differently from the regular LineBatcher either. This sounds like a bug in itself.

As a comparison I made a line material that draws Green when occluded and red when visible as a quick test. Altho this requires me dropping a mesh + material into the scene so it’s not viable for the simple debug rendering I am trying to go for. (the difference in color when occluded isn’t neccessary for the lines I am trying to draw BTW, I really just want to SEE the lines at all even when occluded, eg. adding DepthBias to it)

Thanks guys!

Tom

1 Like

Setting DPG to SDPG_MAX has the same effect?

If you run through the code of the engine you will find that it’s not implemented that way. It checks if it’s DPG foreground, in which case it passes it to the foreground line batcher, although that seems to have zero effect in the end.

Did you solve that issue? I need to render debug line for widget interaction component in VR so it can go through objects. I can do this with separate mesh + material with depth test off, but probably it would be better to do with default “Show Debug” flag.

I did not, would be great to get some support for this.

Anyone know if there’s been any progress on this in the last 5 years?

1 Like

This feature is available in C++, but not exposed to blueprints. I have made a plugin that exposes this for all the drawing methods as well as add a function to draw debug shapes based on a UStaticMesh reference.

It’s not yet available on the marketplace, pending approval - but it’s a free plugin and can be downloaded here.

This is my first plugin, so haven’t had the time to extensively test it yet - but it should be working fine on UE 5.3.

Actually SDPG_Foreground works perfectly fine for me :+1: Maybe some things under the hood changed over the years