-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Fix CSGShape3D
debug collision shapes being visible in editor
#86699
Fix CSGShape3D
debug collision shapes being visible in editor
#86699
Conversation
UPDATE: This issue was previously reported, and was unfortunately misdiagnosed and led to an incorrect solution that introduces another problem that will have to be corrected (perhaps as part of this pull request): The issue was misdiagnosed as being a gizmo that fails to hide. This is not the case - it is runtime debug collision shape visualization, not an editor gizmo. The subsequent merge made the debug collision shape visibility dependent on the visibility of the CSG node itself. While this partially masked the problem of the previously unhideable wireframe (it is now hideable by hiding the CSG visuals), it still is not hideable via the gizmo toggles, and also leads to a new incorrect behaviour: As the documentation for the Because this new pull request will completely remove the debug collision shapes from the editor, the visibility dependency introduced by #84174 can be reverted. I will do this in a commit amend tomorrow. |
b5fe323
to
10babe2
Compare
Aforementioned changes from #84174 have been reverted. |
Let us know if #84174 fixes your bug. |
cf97bf2
to
7b9e280
Compare
@MajorMcDoom it's worth adding screenshots to PRs like this to make clear what the change is. I haven't followed the previous discussions, but this is an interesting one. Traditionally Godot has always had the visual and physics part of an object separate. Collision shapes are drawn in editor as well. You can see this clearly when you move the collision shape away from the object: CSG breaks the mould. It's a single node that handles both the visual and the physics aspect of the object. Showing the collision shape superimposed over the mesh is in a way expected behaviour, you can tell immediately whether you've forgotten to enable collisions or if they are indeed enabled. However, if you're not interested there is no way to hide them, and especially for complex extruded shapes, it can be a lot of visual clutter not to mention that it slows the IDE down. I use CSGPolygon a lot to create stuff like race tracks, often the track itself will be several CSGPolygon shapes all following the same path but without collisions just to bring in detail, and a separate CSGPolygon shape that is used to create the collision shape. It gets pretty gnarly at times :) While I find it important to be able to see the collision shape and would not want that removed, I'd love to hide it once I'm happy with the composition of the scene. |
@BastiaanOlij Thanks for the response! I'm not sure if there's been a miscommunication somewhere, but I'm aware that CSG is a "hybrid" between visual and collision. The problem is:
The debug collision shape is still important to have for CSG at runtime, because the feature should work for all collision shapes. That is why this PR still leaves that intact. Whether or not a CSG should show collision gizmos is a discussion beyond the scope of this PR. The fact is, however, that they are currently not showing gizmos - they are improperly using debug collision shapes in place of gizmos. |
Ah, ok, I indeed missed that nuance. Sounds like a shortcut was taken to make something draw. I'd have to take a closer look to give more sensible feedback :) |
Ok, as best as I can judge there are a few incorrect assumptions here which means I think a little more work needs to be done here. When we look at normal collision shapes it is correct that the debug collision shape is drawn at runtime when this is enabled to help find issues with the collision setup in ones game. When we look at CSG the problem we have is that we have dual functionality here. The main purpose of CSG is the mesh that is generated and the gizmo controls focus on the manipulation of this mesh. The collision shape that can be added is "extra" but we lack control over whether we want to visualise this shape in the IDE. This PR is born out of an understandable annoyance that this shape is always drawn, and drawn fully visible. It thus relegates this to the original functionality of just showing the shape during runtime if collision shapes are enabled in the debug menu. There is however value in seeing the collision shape in the IDE at times and taking that away will frustrate users who rely on seeing that shape. |
CSGMesh3D
debug collision shapes being visible in editor
@BastiaanOlij is right in that there needs to be a proper gizmo solution for There is actually currently no use at all for the
In other words, the current gizmo solution is entirely useless because it only renders a wireframe over an identical underlying mesh, and only when the underlying mesh is already visible. As such, this PR:
|
CSGMesh3D
debug collision shapes being visible in editorCSGShape3D
debug collision shapes being visible in editor
…an old, incorrect fix which made debug collision visibility depend on CSG visibility.
7b9e280
to
a9e51c3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Speaking to @MajorMcDoom on private channels a couple days ago and his further findings reported here, I'm in agreement that the current state of things are as he says and that in order to move forward, fixing one problem at a time is better than endlessly flipping back and forth.
We just have to be mindful that if anyone complains that we don't go back to a more broken situation but make clear that we will be taking steps after this step.
So I'm for merging this and making sure that the current behaviour makes sense, and then in the future following it up with a proper gizmo implementation for CSG collisions.
Thanks! |
For posterity, I've made a follow-up issue here: #96807 |
Can this be cherry-picked for 4.3? The debug draw noise in a level full of CSG composites is very high and it can't be disabled. |
CSGShape3D
is improperly co-opting the debug collision visualization system to render editor gizmos. As such, the gizmos do not respect any gizmo visibility settings (see #87919 ).The only way to control the visibility of the collision gizmos currently is to make the
CSGShape3D
itself invisible (workaround comes from #84174). This is incorrect because an invisibleCSGShape3D
can still have collision, so the gizmo should still be visible. This also affects runtime debug collision visualization (see #96767).This PR makes the debug collision geometry only visible in the running game, essentially removing their usage as gizmos.
CSGShape3D
debug collision visualization disappears when node is made invisible #96767