1
0
Fork 0
godot/editor/import/3d
Arseny Kapoulkine 260287b3a1 Rewrite index optimization code for maximum efficiency
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.
2024-11-04 06:58:06 -08:00
..
collada.cpp Add const lvalue ref to editor/* container parameters 2024-02-26 15:28:15 -03:00
collada.h Set clang-format `RemoveSemicolon` rule to `true` 2024-10-25 13:49:43 -04:00
editor_import_collada.cpp Set animation step from importers. Increase default step from 10 to 30 FPS. 2024-04-19 03:02:20 -07:00
editor_import_collada.h
post_import_plugin_skeleton_renamer.cpp Add ufbx for FBX importing 2024-02-23 22:33:04 +01:00
post_import_plugin_skeleton_renamer.h
post_import_plugin_skeleton_rest_fixer.cpp Enforce correct type for silhouette filter. 2024-08-31 20:35:09 +01:00
post_import_plugin_skeleton_rest_fixer.h ResourceImporterScene: Replace animation bool with an import type string enum 2024-08-27 14:58:18 -07:00
post_import_plugin_skeleton_track_organizer.cpp
post_import_plugin_skeleton_track_organizer.h
resource_importer_obj.cpp Rewrite index optimization code for maximum efficiency 2024-11-04 06:58:06 -08:00
resource_importer_obj.h
resource_importer_scene.cpp Rewrite index optimization code for maximum efficiency 2024-11-04 06:58:06 -08:00
resource_importer_scene.h Add "Use Node Type Suffixes" scene import option 2024-09-09 01:12:14 -07:00
scene_import_settings.cpp Rename internal Button icon to button_icon to match exposed methods 2024-10-29 16:23:03 -07:00
scene_import_settings.h Merge pull request #96094 from SaracenOne/add_3d_skeleton_to_advanced_importer 2024-09-08 23:21:28 +02:00