Laplacian Smooth Normals Explanation
This section explains the Weighted Normals and Laplacian Smoothing uses and behavior, limitations, and technical considerations.
Toon shading needs to be smooth. But the typical Normals of most geometry cause faceted or jagged shading unless the mesh topology is very clean (meaning evenly spaced quads). This is often due to vertex count, but problems remain even on higher poly meshes due to how Normals are calculated. This Modifier calculates them in a different way that compensates for uneven topology. But stylized art also generally wants to reduce detail by smoothing. Typical smoothing methods also only work well on very clean evenly spaced topology, and so re-introduce problems to the Normals. So the Modifier includes Laplacian Smoothing, which is also able to compensate for uneven topology.
The purpose of this Modifier is to make topology not matter for shading. You get the same results as a clean quad mesh on uneven triangulated meshes as long as the overall vertex density is similar.
Face Area Weights
Vertex Normals are calculated by averaging the Normals of the Faces around the vertex. Weights are used to adjust how much each Face contributes to the final Vertex Normal. Blender, and most modern 3D applications, already use Face Corner Angle Weights by default. These compensate for Triangulation, but not spacing.
Face Area Weights are commonly used to improve low and mid poly assets for games, and are available in Blender’s Weighted Normals Modifier. They cause larger faces to count for more. This is excellent for hard surface areas that often have large planar faces but also small faces on corners or details, such as a beveled cube. This method preserves the planes of the shape.
But since it emphasizes differences in face sizes, it is actually counterproductive in areas that are supposed to be smooth, clean surfaces. This Modifier supports typical Face Area Weights like Blender’s, but then also has the option to invert them. This cancels out differences in face size, and thus achieves clean shading despite spacing.
Laplacian Smoothing
Typical smoothing operations like the Smooth Modifier, edit mode command, and Blur Geometry Node work by adjusting the value on a given vertex based on the value of the vertices connected to it by edges. But they do not weight the contribution of each connected vertex, and so are not sensitive to things like edge length or face sizes. Laplacian Smooth does, and so produces consistent results even if topology differs. It does this at the cost of being significantly slower, but this isn’t a problem when pre-calculating game Normals or doing offline rendering.
Blender has a Laplacian Smooth modifier and Edit Mode command. But these only let you smooth the position of meshes, not the Normals. Transferring Normals from a copy of a mesh that has been Laplacian Smoothed is a great way to get some quick improvements. But calculating Normals on a Smoothed Mesh is not the same as smoothing the Normals themselves, and especially not when using it to smooth other custom data (like the Weighted Normals), or when mixing with other Normals methods. The modifier lacks the necessary inputs to get the level of options and artistic control that Geometry Nodes gives.
The Geometry Nodes modifier allows any attribute to be used to control the strength and mix factor of the effect. This could be vertex groups, vertex colors (which can be Point or Face, to allow different values on either side of an edge), or of course attributes created by other Geometry Nodes modifiers or Python scripts. In the future, more options are planned to give further artistic control and to help get the optimal behavior in different situations.
Limitations
Weighted Normals and Laplacian Smoothing solve a whole category of issues related to bad shading. But there are still others! This method solves many problems related to spacing and triangulation. But it will not help with issues related to:
- Insufficient vertex density in a given area to represent the complexity of a shape.
- Extremely low poly meshes (technically the same as the first problem).
- This is greatly reducing Linear Interpolation issues at the vertex level, but does not help with those in the shader itself (such as on very long edges.)
- Meshes with many split edges or disconnected elements, as it relies on connected topology (make a copy with merged vertices, calculate the Normals on that, and then transfer to the original.)
- If used to Calculate Custom Vertex Normals, such as for a game character, these Normals will still have the usual deformation issues. In Blender this can be avoided by keeping the Modifier after any deformation Modifiers in the list.
- Smoothing does not necessarily get you to the stylistically correct shading shape for any given object. For more artistic control, the proxy mesh workflow is still best, but much more labor intensive. But this Modifier makes creating proxy meshes much easier as their topology does not need to be as precise.
- Non-manifold meshes. Laplacian Smoothing does not work properly if an edge has more than two connected faces. Non-manifold meshes should generally be avoided anyway for other reasons, but occasionally are useful.
Additionally, the modifier does not yet support:
- Boundary edge handling on the Weighted Normals. Default normal calculations do not have this either, so it is not a loss. This causes the shading to bend slightly on the faces adjacent to boundaries. The Laplacian Smoothing does have Boundary handling.
- Laplacian Sharpening, which enhances sharp areas instead of smoothing. This should help with many hard surface areas, and similar things like some types of stylized cloth wrinkles.
Additional Technical Notes
- The Modifier writes a vector attribute to the mesh. This can be used by other modifiers, or inputted into Materials via the Attribute node. The name of this Attribute can be changed in the Nodes, but may break the addon currently (probably will be fixed in future versions). If another Attribute is wanted, add a separate Store Attribute node and store a copy of the current attribute under a new name.
- The Preview Custom Normals option causes the Custom Normals to be set from the Attribute in the Evaluated version of the mesh in the dependency graph. The Set Custom Normals option writes them to the original Object from the Evaluated Object. This operation will fail if the meshes do not match, such as if there are modifiers that change the geometry. This is the same behavior as applying any other modifier and can be fixed by temporarily disabling the other modifiers or applying them. However, it will not fail if there are Shape Keys, making this more convenient than the usual method of applying modifiers.
- Weighted Normals have almost no additional performance impact, but Laplacian Smooth is slow! Using more than a few iterations on high poly meshes will produce notable slow down, especially on low end machines. To avoid the possibility of accidentally entering a huge number of Smooth Iterations, the modifier input can only be scrubbed or clicked up to 6 iterations. A higher number can be entered by typing the number into the field. But a max of 9 iterations has been set within the node tree.
- The Laplacian Smooth only runs on triangle meshes. It is run on a triangulated copy of the mesh, and then the result transferred back to the original within the nodes. So the mesh will not be changed. But there is a performance cost to triangulating very large meshes each update, and Laplacian Smooth is already a costly operation. If you are noticing performance issues on large meshes, you can save some performance by putting a Triangulate modifier before the Laplacian Smooth Normals modifier. Blender’s Triangulate Modifier is faster than the Triangulate Geometry Node, and shouldn’t need to be evaluated as often. Or do this manually by copying the object and triangulating the mesh in edit mode.
- Similarly, if the Split Edges option is used, the mesh is split with the Edge Split Node within the nodes and the result transferred to the original. This is also a slight performance impact on high poly meshes that split many edges.