This helps, for importers spitting out new resources to the res://
filesystem to actually hash them to generate deterministic UIDs.
This PR also fixes the determinism for translations.
While all the previous fixes to optimizeVertexCache invocation fixed the
vertex transform efficiency, the import code still was missing two
crucial recommendations from meshoptimizer documentation:
- All meshes should be optimized for vertex cache (this reorders
vertices for maximum fetch efficiency)
- When LODs are used with a shared vertex buffer, the vertex order
should be generated by doing a vertex fetch optimization on the
concatenated index buffer from coarse to fine LODs; this maximizes
fetch efficiency for coarse LODs
The last point is especially crucial for Mali GPUs; unlike other GPUs
where vertex order affects fetch efficiency but not shading, these GPUs
have various shading quirks (depending on the GPU generation) that
really require consecutive index ranges for each LOD, which requires the
second optimization mentioned above. However all of these also help
desktop GPUs and other mobile GPUs as well.
Because this optimization is "global" in the sense that it affects all
LODs and all vertex arrays in concert, I've taken this opportunity to
isolate all optimization code in this function and pull it out of
generate_lods and create_shadow_mesh; this doesn't change the vertex
cache efficiency, but makes the code cleaner. Consequently,
optimize_indices should be called after other functions like
create_shadow_mesh / generate_lods.
This required exposing meshopt_optimizeVertexFetchRemap; as a drive-by,
meshopt_simplifySloppy was never used so it's not exposed anymore - this
will simplify future meshopt upgrades if they end up changing the
function's interface.
"Raycast Normals" was introduced in 4.4 dev and defaulted to "false".
The limited testing results at the time suggested that raycasting
generally reduces normal quality compared to native simplifier results,
at the same time increasing vertex memory and import time.
To play it safe, we introduced a setting that defaulted to false, with
the goal of removing it later in 4.4 development cycle if no regressions
are noticed. Since we already had three dev snapshots and no reports,
this change removes the setting and associated code.
"Normal Split Angle" was only used when raycast normals were enabled;
this change removes it from the settings, but keeps it in the script
binding for compatibility.
Existing meshes import exactly the same after this change (unless they
chose to override raycasting which would be surprising).
split_normals helper was only used in this code path and is also removed
for simplicity; it is unlikely that this code will be useful as is, as
it can only regenerate normals without fixing tangents or updating
positions.
This puts OBJ mesh import on parity with 3D scene import. It's now
possible to have the same level of optimization as imported 3D scenes
while using the OBJ mesh workflow.
`optimize_indices_for_cache()` is now always called on import as well,
similar to what the 3D scene import already does.
Give warning if the size in header mismatch the actual file size. If
data chunk size is greater than the actual data size, try to import by
treating all the remaining data as data chunk and give warning to users.
Better size calculation in advanced importer preview.
Uses the skeleton mesh to calculate the scene's bounding box.
This improves some situations where a mesh instances' scale
does not match its visual representation when a skeleton
is applied.
Advanced importer skeletal preview UX improvement.
Make the visibility of the skeletal preview in the advanced importer
when selecting an animation dependent on a new dedicated toggle button
rather than carrying over whether a skeletal node was or was not previously
selected before selecting the animation.
Advanced importer skeletal preview fix.
Fixes the preview on scaled skeletons in the advanced importer by applying the node's scale
to the preview and generating a skin for it.
This is useful for custom tagging of objects with properties (for example in Blender) and having this available in the editor for scripting.
- Adds import logic to propagate the parsed GLTF extras all the way to the resulting Node->meta
- Adds export logic to save Godot Object meta into GLTF extras
- Supports `nodes`, `meshes` and `materials` (in GLTF sense of the words)
When an imported model Skeleton3D type node is selected, the bones are drawn using lines or octahedrons to provide a clearer reference to their position.
Refactored Skeleton3DGizmoPlugin::redraw now uses a static function to generate bone meshes