blackears / cyclopsLevelBuilder

A Godot plugin to let you block in levels inside the Godot editor.
MIT License
1.09k stars 44 forks source link

Add automatic angle-based smoothing #12

Open Calinou opened 1 year ago

Calinou commented 1 year ago

Right now, all geometry is flat-shaded. This makes cylinders impossible to draw without their geometry looking visibly blocky, even if the geometry itself has enough detail. Smooth shading should be used when it makes sense, ideally doing this automatically based on the angle of each face relative to the others in the shape.

The default angle threshold could be 44°, so that octagons are still flat-shaded but anything smoother is smooth shaded by default. This is the angle threshold used by Cube 2 engine games by default (/lerpangle). This angle threshold could be configured by a project setting or CyclopsGlobalScene node.

There could also be a per-shape property to override the angle threshold for a specific shape, though I don't think this would be needed often. In my experience, an automatic threshold can get you pretty far without having to worry about it :slightly_smiling_face:

Related Godot proposal for CSG: https://github.com/godotengine/godot-proposals/issues/1862