-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
CSGCylinder3D has incorrect normals compared to the CylinderMesh primitive #49800
Comments
CSGSphere has the same issue. Taking a guess, this might be the CSG models not having merging vertices that share the same coordinates - you get similar errors in Blender if you use the spin modifier to make a circular object, but disable "Auto Merge". I've included an exported model in my test project to show what I mean. From top to bottom: CSGSphere, MeshInstance sphere, UV sphere from Blender (made with the spin modifier, Auto Merge disabled). |
I suspect this is what's going on: Here's an illustration of what I suspect is going on: Of course the normals are split on edges with the flat top and bottom faces, but I'm omitting these as they appear to be correct. I have no idea how the code looks like, but maybe this is enough to help fix it? |
I looked briefly at fixing this, but it appears the CSG shape's normals are automatically generated with no way to manually override them: godot/modules/csg/csg_shape.cpp Lines 384 to 397 in 73ece5b
|
See also #19143.
Godot version
4.0.dev (6d98f84), 3.3.2
System information
Fedora 34, GeForce GTX 1080 (NVIDIA 465.31)
Issue description
CSGCylinder3D has incorrect normals compared to the CylinderMesh primitive.
CSGTorus3D also has unexpected normals compared to a torus exported from Blender (due to a sharp line in the middle), but it's not as bad.
Top: CSG nodes (torus, box, sphere, cylinder) or meshes (Suzannes, sharp cylinder).
Bottom: MeshInstances with primitive meshes (box, sphere, smooth cyulinder) or OBJs exported from Blender (torus, Suzannes, sharp cylinder).
This also occurs on 3.3.2. CSGCylinder on top, MeshInstance with CylinderMesh at the bottom:
Steps to reproduce
Minimal reproduction project
master
: test_csg_normals.zip3.x
: test_csg_normals_3.x.zipThe text was updated successfully, but these errors were encountered: