-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
Use automatic angle-based smoothing for CSG faces instead of manual per-node smoothing #1862
Comments
This sounds really good to me, I only have one question: Couldn't this setting be done per CSG mesh? (probably only using the value of the "root" CSG node and showing a warning if enabled on a non root node). That way different CSG meshes could have different setting. But regardless of this it would be really helpful to have this. |
@winston-yallow I'm not sure how useful it would be to have this setting on a per-node basis. This is why I suggested making it a project setting instead. Also, I'm worried that intersections with different CSG nodes could cause conflicts or performance issues. |
Blenders Auto Smooth is a similar to the edge split modifier, it splits all edges above a certain angle, making them sharp. |
@madmiraal I forgot to mention that CSGCylinder is indeed smoothed by default, but that's not the issue I had here. The issue I have right now is mainly with CSGPolygon nodes. Here's an example: Smooth Faces disabledSmooth Faces enabledI'd like something akin to CSGCylinder where the top and bottom faces aren't smoothed, and only the side sections are: However, I'd also like to have an angle limit so that sharp angles are never smoothed in CSGPolygon. Edit: Looking at it again, it seems the top and bottom faces are actually sharp. I think there's a bug in the smoothing of side faces in CSGPolygon? |
Describe the project you are working on:
The Godot editor 🙂
Describe the problem or limitation you are having in your project:
Designing a nice-looking CSG prototype takes longer than it should, since you have to manually mark all curved surfaces as smooth to get a good appearance.
On top of that, marking CSG nodes as smooth is an all-or-nothing process. For example, you can't have only certain polygons of a CSGPolygon be marked as smooth.
Describe the feature / enhancement and how it helps to overcome the problem or limitation:
Automatic smoothing based on angle could be used to smooth out curved surfaces automatically. This way, the user would never have to fiddle with smoothness settings while designing their level.
In Blender, this is known as Auto Smooth (make sure to mark the whole object as smooth too):
Also, most level design tools provide this feature in an automatic manner (such as Cube 2's map editor):
lerpangle 44
(the default):lerpangle 89
:Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams:
This angle calculation will likely slow down CSG mesh generation a bit. If you use CSG in a real-time scenario (which isn't recommended), you can still set the maximum angle to 0 to skip the automatic smoothing calculations.
If this enhancement will not be used often, can it be worked around with a few lines of script?:
No, as this is core CSG functionality.
Is there a reason why this should be core and not an add-on in the asset library?:
See above.
The text was updated successfully, but these errors were encountered: