diff --git a/crates/bevy_pbr/src/lib.rs b/crates/bevy_pbr/src/lib.rs index 6bd4751931..a6c94badf4 100644 --- a/crates/bevy_pbr/src/lib.rs +++ b/crates/bevy_pbr/src/lib.rs @@ -16,6 +16,7 @@ pub mod wireframe; /// Expect bugs, missing features, compatibility issues, low performance, and/or future breaking changes. #[cfg(feature = "meshlet")] pub mod experimental { + /// Render high-poly 3d meshes using an efficient GPU-driven method. See [`MeshletPlugin`] and [`MeshletMesh`] for details. pub mod meshlet { pub use crate::meshlet::*; } diff --git a/crates/bevy_pbr/src/meshlet/meshlet_mesh_material.wgsl b/crates/bevy_pbr/src/meshlet/meshlet_mesh_material.wgsl index ec67868aad..1309c7884c 100644 --- a/crates/bevy_pbr/src/meshlet/meshlet_mesh_material.wgsl +++ b/crates/bevy_pbr/src/meshlet/meshlet_mesh_material.wgsl @@ -18,7 +18,7 @@ fn vertex(@builtin(vertex_index) vertex_input: u32) -> @builtin(position) vec4) -> @location(0) vec4 { let vertex_output = resolve_vertex_output(frag_coord); - var rng = vertex_output.meshlet_id; + var rng = vertex_output.cluster_id; let color = vec3(rand_f(&rng), rand_f(&rng), rand_f(&rng)); return vec4(color, 1.0); } diff --git a/crates/bevy_pbr/src/meshlet/mod.rs b/crates/bevy_pbr/src/meshlet/mod.rs index fd73e35c4a..5176087d49 100644 --- a/crates/bevy_pbr/src/meshlet/mod.rs +++ b/crates/bevy_pbr/src/meshlet/mod.rs @@ -95,7 +95,6 @@ const MESHLET_MESH_MATERIAL_SHADER_HANDLE: Handle = /// Once meshes are pre-processed into a [`MeshletMesh`], this plugin can render these kinds of scenes very efficiently. /// /// In comparison to Bevy's standard renderer: -/// * Minimal rendering work is done on the CPU. All rendering is GPU-driven. /// * Much more efficient culling. Meshlets can be culled individually, instead of all or nothing culling for entire meshes at a time. /// Additionally, occlusion culling can eliminate meshlets that would cause overdraw. /// * Much more efficient batching. All geometry can be rasterized in a single indirect draw. @@ -104,7 +103,7 @@ const MESHLET_MESH_MATERIAL_SHADER_HANDLE: Handle = /// * Much greater base overhead. Rendering will be slower than Bevy's standard renderer with small amounts of geometry and overdraw. /// * Much greater memory usage. /// * Requires preprocessing meshes. See [`MeshletMesh`] for details. -/// * More limitations on the kinds of materials you can use. See [`MeshletMesh`] for details. +/// * Limitations on the kinds of materials you can use. See [`MeshletMesh`] for details. /// /// This plugin is not compatible with [`Msaa`], and adding this plugin will disable it. /// diff --git a/crates/bevy_pbr/src/meshlet/visibility_buffer_resolve.wgsl b/crates/bevy_pbr/src/meshlet/visibility_buffer_resolve.wgsl index 0a6ca684bf..3af1c1a506 100644 --- a/crates/bevy_pbr/src/meshlet/visibility_buffer_resolve.wgsl +++ b/crates/bevy_pbr/src/meshlet/visibility_buffer_resolve.wgsl @@ -85,7 +85,7 @@ struct VertexOutput { ddy_uv: vec2, world_tangent: vec4, mesh_flags: u32, - meshlet_id: u32, + cluster_id: u32, #ifdef PREPASS_FRAGMENT #ifdef MOTION_VECTOR_PREPASS motion_vector: vec2, @@ -176,7 +176,7 @@ fn resolve_vertex_output(frag_coord: vec4) -> VertexOutput { ddy_uv, world_tangent, instance_uniform.flags, - meshlet_id, + cluster_id, #ifdef PREPASS_FRAGMENT #ifdef MOTION_VECTOR_PREPASS motion_vector,