Optimizing normals: using OPTIMIZE_KEEP_NORMALS flag
Normals is one of the more sensitive aspect of optimization.
Most of the mesh are provided without user normals. In such case, the Polygon Cruncher generates some normals for the file.
This is what we call auto generated normals.
In such case, OPTIMIZE_KEEP_NORMALS is not recommended as normal are generated automatically.
Adding OPTIMIZE_KEEP_NORMALS during optimization is an additional constraint which might give less interesting results.
When some users normals are defined, this can be important to activate OPTIMIZE_KEEP_NORMALS.
OPTIMIZE_KEEP_NORMALS works in conjunction with the normal threshold which can be set using
Code: Select all
By default the normal threshold is set to 10.0 degree (converted to radian).
What does the threshold means?
Consider this car door.
This door embed user normals that were created to force an hard edge line along the door.
We would like to make the optimizer consider this line as a seams and prevent moving the points on that line during optimization.
This is what we can do using the normal tolerance value combined to the OPTIMIZE_KEEP_NORMALS, OPTIMIZE_PROTECT_NORMALS or OPTIMIZE_EXCLUDE_NORMALS flags.
If you use one OPTIMIZE_KEEP_NORMALS / OPTIMIZE_PROTECT_NORMALS the point belonging to that line might move but there is a penalty for moving them.
If you use OPTIMIZE_EXCLUDE_NORMALS the point are locked.
Here is the point that are impacted by this flags when you set the threshold to 10.0°.
If you set a lower threshold, you'll get more impacted points: