godot/scene/resources/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
..
box_shape_3d.cpp Move 3D-only resources to their own folder 2024-02-26 05:23:04 -06:00
box_shape_3d.h Move 3D-only resources to their own folder 2024-02-26 05:23:04 -06:00
capsule_shape_3d.cpp Move 3D-only resources to their own folder 2024-02-26 05:23:04 -06:00
capsule_shape_3d.h Move 3D-only resources to their own folder 2024-02-26 05:23:04 -06:00
concave_polygon_shape_3d.cpp Move 3D-only resources to their own folder 2024-02-26 05:23:04 -06:00
concave_polygon_shape_3d.h Move 3D-only resources to their own folder 2024-02-26 05:23:04 -06:00
convex_polygon_shape_3d.cpp Fix debug line drawing with tiny convex hull mesh colliders 2024-10-30 00:47:56 -07:00
convex_polygon_shape_3d.h Move 3D-only resources to their own folder 2024-02-26 05:23:04 -06:00
cylinder_shape_3d.cpp Move 3D-only resources to their own folder 2024-02-26 05:23:04 -06:00
cylinder_shape_3d.h Move 3D-only resources to their own folder 2024-02-26 05:23:04 -06:00
fog_material.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
fog_material.h Move 3D-only resources to their own folder 2024-02-26 05:23:04 -06:00
height_map_shape_3d.cpp Add HeightMapShape3D update with Image data 2024-04-04 02:10:00 +02:00
height_map_shape_3d.h Add HeightMapShape3D update with Image data 2024-04-04 02:10:00 +02:00
importer_mesh.cpp Rewrite index optimization code for maximum efficiency 2024-11-04 06:58:06 -08:00
importer_mesh.h Rewrite index optimization code for maximum efficiency 2024-11-04 06:58:06 -08:00
mesh_library.cpp Move 3D-only resources to their own folder 2024-02-26 05:23:04 -06:00
mesh_library.h Move 3D-only resources to their own folder 2024-02-26 05:23:04 -06:00
navigation_mesh_source_geometry_data_3d.cpp Set clang-format RemoveSemicolon rule to true 2024-10-25 13:49:43 -04:00
navigation_mesh_source_geometry_data_3d.h Add bounds function to NavigationMeshSourceGeometryData 2024-08-19 00:12:37 +02:00
primitive_meshes.cpp Merge pull request #93602 from aaronp64/inspector_latency 2024-08-22 00:10:26 +02:00
primitive_meshes.h Set clang-format RemoveSemicolon rule to true 2024-10-25 13:49:43 -04:00
SCsub SCons: Add unobtrusive type hints in SCons files 2024-09-25 09:34:35 -05:00
separation_ray_shape_3d.cpp Move 3D-only resources to their own folder 2024-02-26 05:23:04 -06:00
separation_ray_shape_3d.h Move 3D-only resources to their own folder 2024-02-26 05:23:04 -06:00
shape_3d.cpp Move 3D-only resources to their own folder 2024-02-26 05:23:04 -06:00
shape_3d.h Move 3D-only resources to their own folder 2024-02-26 05:23:04 -06:00
skin.cpp Move 3D-only resources to their own folder 2024-02-26 05:23:04 -06:00
skin.h Move 3D-only resources to their own folder 2024-02-26 05:23:04 -06:00
sky_material.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
sky_material.h Move 3D-only resources to their own folder 2024-02-26 05:23:04 -06:00
sphere_shape_3d.cpp Move 3D-only resources to their own folder 2024-02-26 05:23:04 -06:00
sphere_shape_3d.h Move 3D-only resources to their own folder 2024-02-26 05:23:04 -06:00
world_3d.cpp Use Core/Scene stringnames consistently 2024-05-13 23:41:07 +02:00
world_3d.h Move 3D-only resources to their own folder 2024-02-26 05:23:04 -06:00
world_boundary_shape_3d.cpp Move 3D-only resources to their own folder 2024-02-26 05:23:04 -06:00
world_boundary_shape_3d.h Move 3D-only resources to their own folder 2024-02-26 05:23:04 -06:00