-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
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 mixed smoothed and non-smoothed face normals computation for CSG shapes #59039
Fix mixed smoothed and non-smoothed face normals computation for CSG shapes #59039
Conversation
CC @hoontee |
Fixes #49800. |
After fixing the style issue, be sure to rebase to squash the commits into one (see https://docs.godotengine.org/en/latest/community/contributing/pr_workflow.html#the-interactive-rebase). |
By the way, this likely supersedes godotengine/godot-proposals#1862. Great work 🙂 |
@akien-mga Thanks, I'll read and try that |
d323010
to
a7f4a3e
Compare
a7f4a3e
to
ec2984f
Compare
No, there are still instances where angle based smoothing would be appreciable. Note the odd lighting on the cylinder due to a lack of hard edges around the sphere negation: |
Thanks! |
Cherry-picked for 3.5. |
Cherry-picked for 3.4.4. |
When computing smoothed normals on CSG shapes, the normals from all the faces sharing a vertex are averaged together to compute the smoothed "shared" normal between the faces.
I don't think the behavior is correct, because it means that even faces that are not smoothed participate to the computation of their smooth neighbor's faces.
The problem is particularly visible when substracting a sphere or a torus from a box, at the edge between them :
Before
After
and also on the cylinder which has a strange shading (and a small glitch is visible at the bottom left) :
Before
After
This is related to some comments in #49800.
Bugsquad edit: