Open kebabskal opened 5 months ago
The normal node debug shapes for collisions are part of CollisionObject3D::_update_shape_data(). The CSG debug is part of CSGShape3D::_update_debug_collision_shape().
That the gizmo toggles do nothing is nearly always a sign of a debug that is done by servers directly as the gizmos only react on nodes that are controlled by an editor gizmo that toggles both material and visibility. If those do not exist those gizmo toggles do nothing.
I'm also using Godot 4.2.1.stable.mono and I can't seem to toggle off the blue wireframes for my CSGBox3D Nodes when looking from the viewport.
I've started looking into this. I ended up just commenting out some code locally, but since there seems to be atleast one other person bothered by this, I'll drop my findings below:
CSGShape3D::_update_debug_collision_shape()
seems to be where the shapes are submitted to be drawn.
It asks if it should from CSGShape3D::_is_debug_collision_shape_visible()
which always returns true in the editor.
If I comment out the contents of CSGShape3D::_update_debug_collision_shape()
the blue collision wireframes goes away. Gray wireframes are still shown when "Show Gizmos" is toggled on. I assume these are the regular "draw" shapes.
I don't know if the draw and collision shapes are always going to be the same, and if so, would there ever be a use for drawing the collisions wires? One version would be to just draw them once, in gray if collision is off and in blue if on.
I'm not sure if it's also somehow affected by the fact that only root CSG shapes are drawn etc.
While the state of the Show Gizmos checkbox is somehow saved in the menu there doesn't seem to be good central place to query for it without having a reference to the actual popup menu.
Instead, toggling it seems to directly change a culling mask on the viewport camera through
camera->set_cull_mask(layers)
.
I'll keep looking once I have a bit more time.
I appreciate you sharing what you've found so far, I'll try out the commenting out method when I get the chance to!
Tested versions
Reproducible in Godot v4.2.1.stable and v4.3 custom build
System information
Godot v4.2.1.stable - Windows 10.0.22621 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 2070 (NVIDIA; 31.0.15.4633) - AMD Ryzen 7 5800X 8-Core Processor (16 Threads)
Issue description
When unchecking View Gizmos in the Perspective menu in the Editor 3D Scene collision wireframes for CSG nodes doesn't get hidden. This is inconsistent with for example CollisionShape3D's, which properly gets hidden.
Hiding the node Hiding the node makes the collider disappear, but if you open another scene and then return the render mesh is hidden but the collision mesh is again showing.
Why is this an issue? This gets visually noisy and makes tuning the look of my game difficult.
Steps to reproduce
Minimal reproduction project (MRP)
csg-wireframe-issue-reproduction-project.zip