The main goal of this PR is to safeguard when a base or instantiated scene changes (nodes renamed, moved or readded),
that the hierarchy is still maintained and the node and its overridden properties can be preserved.
What it does:
* Implements unique node IDs.
* These IDs act as a fallback to names when saving.
* The IDs are **USED AS A FALLBACK**, so they are just an addition. It should not break any current existing scene.
* If a scene renames or moves a node, inherited or instantiated scenes will no longer lose reference to it.
Unlike the previous approach, this one is intended to be a fallback, only used if the node is not found.
This makes it safer to implement and ensure that, at worst case, we fail to find the node, but nothing breaks.
Remove cross-project includes from `hashfuncs.h`.
Improve hashing function for `Color` (based on values instead of `String`).
Move `Variant` comparison from `hash_map.h` to `dictionary.cpp` (`VariantComparatorDictionary`), where it's used.
Remove now unnecessary `HashableHasher`.
In addition to the regular edge collapse, we now allow the simplifier to
remove small isolated components. Components that are removed are below
the error threshold in size and as such should not noticeably contribute
to the overall rendering of the object.
This helps simplify topologically complex but small parts of larger
meshes and more comfortably reach the LOD targets.
In some cases, pruning can cause the last LOD to shrink to 0 triangles
which may prevent a slightly larger LOD from being used at the maximum
distance; in this case we retry simplification without pruning once.
Instead of simplifying every LOD from the original down to an
increasing number of triangles, we simplify each LOD from the previous
LOD and stop when the simplification can't proceed further.
This has a few benefits:
- It's significantly faster; using sparse flag helps ensure that
subsequent simplifications after the first one are increasingly
cheaper.
- It results in higher quality attributes on generated LODs; attribute
quadrics reduce the quality of attribute preservation the more they
are accumulated, so recomputing them from intermediate geometry helps.
- It results in monotonic appearance: if a feature is reduced in a
higher LOD, it will stay reduced or get reduced more significantly in
lower LODs. This is not a significant problem right now, but can be
helpful to ensure if the number of LODs increases or some newer
features get enabled.
This significantly improves LOD quality for skinned objects, especially
if the skinned object geometry is very simple (e.g. planar or
cylindrical) in bind pose.
Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>