-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
SurfaceTool.add_smooth_group() has no effect #65104
Comments
I think you're supposed to call |
You are right, if you call it once before adding any vertex, you get smoothed normals but calling it for every vertex gets you "hard" normals again... |
I think the documentation could be clearer about this. There are other What I think happens is that you can't smooth the normals of a group if the group has only one vertex. So you need to call The Procedural Geometry SurfaceTool tutorial does mention Speaking of Procedural Geometry, I just noticed, but only the |
Fixed by #68034. |
Godot version
3.5 a264b68
System information
Manjaro Linux
Issue description
SurfaceTool.add_smooth_group() is supposed to generate smooth normals for the vertices it is called for but it does not have any effect.
I looked into the C++ source code and think I know what is causing the issue. In SurfaceTool.generate_normals() a HashMap is used to find double vertices (ones that are exactly the same) and then add the normals of the double vertices together. This way a vertex on the edge of two faces will get the sum of the normals for both faces as its smoothed normal.
The problem is that the HashMap does not only check for the hash of two objects to be the same but also checks if both objects are the very same object. This is obviously not true for any two vertices since they are separate objects and thus no smooth normals are calculated.
Steps to reproduce
Minimal reproduction project
SurfaceTool.zip
The text was updated successfully, but these errors were encountered: