bevy/crates/bevy_pbr/src
Patrick Walton 72ddac140a
Retain RenderMaterialInstances and RenderMeshMaterialIds from frame to frame. (#16985)
This commit makes Bevy use change detection to only update
`RenderMaterialInstances` and `RenderMeshMaterialIds` when meshes have
been added, changed, or removed. `extract_mesh_materials`, the system
that extracts these, now follows the pattern that
`extract_meshes_for_gpu_building` established.

This improves frame time of `many_cubes` from 3.9ms to approximately
3.1ms, which slightly surpasses the performance of Bevy 0.14.

(Resubmitted from #16878 to clean up history.)

![Screenshot 2024-12-17
182109](https://github.com/user-attachments/assets/dfb26e20-b314-4c67-a59a-dc9623fabb62)

---------

Co-authored-by: Charlotte McElwain <charlotte.c.mcelwain@gmail.com>
Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
2025-01-22 03:35:46 +00:00
..
cluster Move Resource trait to its own file (#17469) 2025-01-21 19:47:08 +00:00
decal Forward decals (port of bevy_contact_projective_decals) (#16600) 2025-01-15 02:31:30 +00:00
deferred Don't reëxport bevy_image from bevy_render (#16163) 2024-11-10 06:54:38 +00:00
light Retain RenderMaterialInstances and RenderMeshMaterialIds from frame to frame. (#16985) 2025-01-22 03:35:46 +00:00
light_probe Move Resource trait to its own file (#17469) 2025-01-21 19:47:08 +00:00
lightmap Move Resource trait to its own file (#17469) 2025-01-21 19:47:08 +00:00
meshlet Retain RenderMaterialInstances and RenderMeshMaterialIds from frame to frame. (#16985) 2025-01-22 03:35:46 +00:00
prepass Use multi_draw_indirect_count where available, in preparation for two-phase occlusion culling. (#17211) 2025-01-14 21:19:20 +00:00
render Retain RenderMaterialInstances and RenderMeshMaterialIds from frame to frame. (#16985) 2025-01-22 03:35:46 +00:00
ssao Move Resource trait to its own file (#17469) 2025-01-21 19:47:08 +00:00
ssr Move Resource trait to its own file (#17469) 2025-01-21 19:47:08 +00:00
volumetric_fog Move Resource trait to its own file (#17469) 2025-01-21 19:47:08 +00:00
components.rs Support non-Vec data structures in relations (#17447) 2025-01-20 21:26:08 +00:00
extended_material.rs Forward decals (port of bevy_contact_projective_decals) (#16600) 2025-01-15 02:31:30 +00:00
fog.rs Remove all deprecated code (#16338) 2025-01-05 20:33:39 +00:00
lib.rs Retain RenderMaterialInstances and RenderMeshMaterialIds from frame to frame. (#16985) 2025-01-22 03:35:46 +00:00
material_bind_groups.rs Move Resource trait to its own file (#17469) 2025-01-21 19:47:08 +00:00
material.rs Retain RenderMaterialInstances and RenderMeshMaterialIds from frame to frame. (#16985) 2025-01-22 03:35:46 +00:00
mesh_material.rs Revert default mesh materials (#15930) 2024-10-15 19:47:40 +00:00
parallax.rs bevy_reflect: FromReflect Ergonomics Implementation (#6056) 2023-06-29 01:31:34 +00:00
pbr_material.rs Fix some punctuation (#17368) 2025-01-14 21:51:12 +00:00
wireframe.rs Fix a few typos (#17292) 2025-01-10 22:48:30 +00:00