Archive 17/01/2023.

DebugRenderer and UI element View3D

Kai

Hi,
There is a trick to show the DebugRenderer in the UI element View3D ?
Thanks.

cadaver

Currently debug geometry rendering is limited to backbuffer views. It should be possible to add an API for enabling it in any view.

Kai

Thanks, I will look into it.

cadaver

If you pull the latest master, there is now option to control per viewport ( Viewport::SetDrawDebug() ) whether debug geometry should render, instead of hardcoding to backbuffer views only. Default is true. Naturally, a DebugRenderer component is also required in the scene the viewport is referring to.

Kai

Wow, thanks !
This confirms the right choice I made by switching to Urho3D : you are very attentive.
But I’m sorry to say that I have a problem : the debug geometry is Y axis reversed on UI element View3D.
I use Urho3D 1.31 and OpenGL. Maybe a problem with OpenGL coordinate system ?

cadaver

Good find. Drawing to textures on OpenGL requires special attention (flipping the projection matrix) and in this case the projection is un-flipped too early.

cadaver

Should be fixed now. Additionally, debug geometry rendering in OpenGL deferred mode should be improved now such that the correct depth buffer values (and thus correct depth testing) are used.

Kai

It’s fixed, thanks again.