-
-
Notifications
You must be signed in to change notification settings - Fork 23.7k
Ignore backfaces during Node3D selection #110185
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
base: master
Are you sure you want to change the base?
Ignore backfaces during Node3D selection #110185
Conversation
|
This should also be implemented for remote selection. |
d388708 to
746aa1d
Compare
✔️ Done. |
746aa1d to
d43059d
Compare
d43059d to
4325e1f
Compare
Calinou
left a comment
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.
Tested locally on https://github.com/Calinou/godot-reflection, it works as expected. Code looks good to me.
In the example below, the camera is stuck inside geometry.
Before
ignore_backfaces_before.mp4
After
ignore_backfaces_after.mp4
|
Does it need to be a setting? Why would someone want to turn it off? |
I can't see a reason to turn it off, so I think the setting should be removed too. We can introduce it in a future PR if there's a proven need for it. |
4325e1f to
93195f5
Compare
|
I've removed the editor setting and hardcoded our two calls to |
|
Note that the cull mode the given mesh is rendered with is not being accounted for anyhow (it's the same before/after this PR though). So while this PR fixes the behavior for the Without this PR (v4.5.stable.official [876b290]):
With this PR (v4.5.beta.
E.g. selection for double sided Sprite3D (by default Before: Godot_v4.5-stable_win64_NrlaBoyJEj.mp4After: godot.windows.editor.x86_64_eufXVIyjSr.mp4 |
|
In our case the PR would be an improvement, we have levels full of 3D models (each wall, floor, ceiling is a mesh on its own) and none of them have front face culling. I think that will be the case for the majority of users, at least I can't imagine otherwise. We use Sprite3Ds mostly as billboards, and I guess the PR does not account for that either (it's already a problem in the current way of selecting). |
|
Addressing @kleonc's concerns, I've added an extra commit on which I'd appreciate some feedback.
This means that the new parameter accepted by All of this can be tested in the scene here: backface_test.zip Here's the problem: Alternatively, I can revert this commit, retaining the bandaid fix for Sprite3D, and then branch off the remaining functionality into another draft PR, where an optimised way of doing this can be discussed, and the fix for Sprite3D can be replaced with something that can represent all mesh planes. |
8677866 to
aa78e68
Compare
aa78e68 to
34e1cf1
Compare
Indeed, this will introduce usability issues in large projects even if they didn't run into any issues previously. In this sense, it would be a regression. I think we should hold off on merging this until we find a more optimized approach. Maybe reusing the depth buffer is something we should do eventually... |
Closes #12550.
Adds an editor setting3D > Ignore Backfaces on Selectionthat istrueby default.Adds an optional parameter and an if statement to TriangleMesh's
intersect_rayfunction.