godot/scene
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
..
2d Compile certain CanvasItem._edit_*() functions with DEBUG_ENABLED 2024-11-02 15:43:18 -03:00
3d Add "Game" editor for better runtime debugging 2024-10-30 11:42:17 -03:00
animation Merge pull request #97020 from GuilhermeGSousa/fix-non-const-anim-node-process 2024-10-29 19:26:00 -05:00
audio Add "Game" editor for better runtime debugging 2024-10-30 11:42:17 -03:00
debugger Add "Game" editor for better runtime debugging 2024-10-30 11:42:17 -03:00
gui Compile certain CanvasItem._edit_*() functions with DEBUG_ENABLED 2024-11-02 15:43:18 -03:00
main Compile certain CanvasItem._edit_*() functions with DEBUG_ENABLED 2024-11-02 15:43:18 -03:00
resources Rewrite index optimization code for maximum efficiency 2024-11-04 06:58:06 -08:00
theme Merge pull request #88530 from davthedev/tree-hover-items 2024-10-21 16:39:16 -05:00
property_list_helper.cpp Always store ID of PopupMenu items 2024-08-20 15:33:21 +02:00
property_list_helper.h Fix a bunch of orphan StringName errors at ProjectSettings/Editor exit 2024-07-09 19:38:52 +03:00
property_utils.cpp Enforce that custom nodes keep their original type 2024-10-22 18:18:16 +02:00
property_utils.h Fix default NodePaths saved in scene 2024-06-03 13:10:23 +02:00
register_scene_types.cpp Implement asynchronous transfer queues, thread guards on RenderingDevice. Add ubershaders and rework pipeline caches for Forward+ and Mobile. 2024-10-02 15:11:58 -03:00
register_scene_types.h
scene_string_names.cpp Enforce that custom nodes keep their original type 2024-10-22 18:18:16 +02:00
scene_string_names.h Enforce that custom nodes keep their original type 2024-10-22 18:18:16 +02:00
SCsub SCons: Add unobtrusive type hints in SCons files 2024-09-25 09:34:35 -05:00