mirror of
https://github.com/bevyengine/bevy
synced 2024-11-22 04:33:37 +00:00
Meshlet misc (#13761)
- Copy module docs so that they show up in the re-export - Change meshlet_id to cluster_id in the debug visualization - Small doc tweaks
This commit is contained in:
parent
298b01f10d
commit
50ee483665
4 changed files with 5 additions and 5 deletions
|
@ -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::*;
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ fn vertex(@builtin(vertex_index) vertex_input: u32) -> @builtin(position) vec4<f
|
|||
@fragment
|
||||
fn fragment(@builtin(position) frag_coord: vec4<f32>) -> @location(0) vec4<f32> {
|
||||
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);
|
||||
}
|
||||
|
|
|
@ -95,7 +95,6 @@ const MESHLET_MESH_MATERIAL_SHADER_HANDLE: Handle<Shader> =
|
|||
/// 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<Shader> =
|
|||
/// * 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.
|
||||
///
|
||||
|
|
|
@ -85,7 +85,7 @@ struct VertexOutput {
|
|||
ddy_uv: vec2<f32>,
|
||||
world_tangent: vec4<f32>,
|
||||
mesh_flags: u32,
|
||||
meshlet_id: u32,
|
||||
cluster_id: u32,
|
||||
#ifdef PREPASS_FRAGMENT
|
||||
#ifdef MOTION_VECTOR_PREPASS
|
||||
motion_vector: vec2<f32>,
|
||||
|
@ -176,7 +176,7 @@ fn resolve_vertex_output(frag_coord: vec4<f32>) -> VertexOutput {
|
|||
ddy_uv,
|
||||
world_tangent,
|
||||
instance_uniform.flags,
|
||||
meshlet_id,
|
||||
cluster_id,
|
||||
#ifdef PREPASS_FRAGMENT
|
||||
#ifdef MOTION_VECTOR_PREPASS
|
||||
motion_vector,
|
||||
|
|
Loading…
Reference in a new issue