Open ghsoares opened 4 years ago
We can probably add a Smooth Faces enum to PrimitiveMesh with the following values:
When doing this, we'd replace the mesh-specific "smooth faces" properties that were added over time.
I started working on this: https://github.com/Calinou/godot/tree/primitivemesh-add-shading-mode
I most likely won't have time to complete this though, so please continue from that branch if you'd like this feature.
Describe the project you are working on: A low poly racing game.
Describe the problem or limitation you are having in your project: I'm creating a low poly racing game, and for any low poly projects, the rendered meshes would need to have flat normals instead of blended normals that give the smooth look even with low vertice count. The problem is that in Godot, we can't automatically create a PrimitiveMesh with flat surface, the generated mesh have smooth normals that isn't the desired look to a low poly project.
Describe the feature / enhancement and how it helps to overcome the problem or limitation: The feature is a simple boolean option to choose if the generated mesh will have flat or rounded normals. The only PrimitiveMesh inherited classes that would be nice to have this feature is CapsuleMesh, CylinderMesh and SphereMesh.
Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams: I don't know exactly how these PrimitiveMesh is generated in code, but if it uses the SurfaceTool to generate the meshes, the simple solution is to use "add_smooth_group(smooth_boolean_variable)" to generate the mesh with or without smooth normals.
If this enhancement will not be used often, can it be worked around with a few lines of script?: Can be created using the SurfaceTool and Mathematic knowledge to create the primitives with this option, but this makes harder to a new user create a simple low poly project with no effort. The other solution is to create manually these meshes in Blender and them export to Godot, but again, slows down the workflow.
Is there a reason why this should be core and not an add-on in the asset library?: Because this can be really useful to create fast low poly meshes in editor, can be used in Particles node and to a lot of other creative things.