Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request]: Provide an option to always draw debug geometry on top of everything else #7

Closed
visuallization opened this issue Jan 13, 2023 · 8 comments
Labels
enhancement New feature or request

Comments

@visuallization
Copy link

Feature description

Hey there!

First of all, thanks for the great plugin. Having convenient debug drawing capabilities in godot with your plugin really makes life easier.

I have a question/feature request: Is it possible to draw the debug geometry always on top of everything else. So e.g. if I would draw a line visuallizing a raycast, would it be possible to still see the line once it enters a mesh? I would also find this convenient e.g. when I am calculating some positions in a mesh and want to make sure I actually calculated the position correctly by displaying them with debug draws. Hope this makes sense.

Maybe this is already possible, but if not it would be great to have this option as well.

Cheers,
Florentin

Solution approach

Provide an option to always draw debug geometry on top of everything else.

@visuallization visuallization added the enhancement New feature or request label Jan 13, 2023
@visuallization visuallization changed the title [Feature Request]: [Feature Request]: Provide an option to always draw debug geometry on top of everything else Jan 13, 2023
@DmitriySalnikov
Copy link
Owner

Do you mean to draw all the geometry on top of everything else? Or only certain draw_* calls, for example with the no_depth_test=true flag?
image

If the first option, then it's not difficult to add (just change the material parameter), but if the second one, then I can use the idea from #3, like:

DebugDraw.set_depth_test(false)
DebugDraw.draw_box(...) # draw box on top of everything else
DebugDraw.set_depth_test(true)
DebugDraw.draw_sphere(...) # normal draw

And somewhere on _init()

DebugDraw.default_depth_test = true

or expose it in ProjectSettings.

And I suppose this is necessary for Godot 3 and 4?

@visuallization
Copy link
Author

Hey there,
Thanks for the reply!
Yes I was rather think about the second solution and support for Godot 3 + 4 would be really cool!

Regarding your proposed first solution, I think I still might be missing something. Can you assign a material to a debug draw call? Or do you mean I should set no_dept_test on the object I want to draw on, because if I do that, it does not seem to work.

Cheers

@DmitriySalnikov
Copy link
Owner

DmitriySalnikov commented Jan 15, 2023

The screenshot was just for reference to the No depth test flag.
Now there is no way to change this parameter of the material through the DebugDraw API.

First I want to port what already worked in Godot 3, then I will add something new.

But for now, you can manually change this parameter of the materials (only in godot 3)
Godot_v3 5 1-stable_win64_BK4xMg20bS

@danbronsema
Copy link

This would be really helpful to be able to do in godot 4. Sometimes my points get hidden behind my objects and it'd be helpful to have them always appear on top.

@bassj
Copy link

bassj commented Nov 20, 2023

I would also like this feature.

@skooter500 skooter500 mentioned this issue Mar 12, 2024
@kotx
Copy link

kotx commented Apr 13, 2024

This would be great!

@DmitriySalnikov
Copy link
Owner

Since my gizmo is drawn with separate lines and arrows, disabling the depth test leads to incorrect sorting of objects.

godot.windows.editor.dev.x86_64.mono_yUdellm4Ro.1.1.mp4

But using wireframes it is not noticeable :)

godot.windows.editor.dev.x86_64.mono_nBVttz9eZK.mp4

@DmitriySalnikov
Copy link
Owner

implemented in da6f672

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants