
# Objective - Implements a more efficient, GPU-driven (https://github.com/bevyengine/bevy/issues/1342) rendering pipeline based on meshlets. - Meshes are split into small clusters of triangles called meshlets, each of which acts as a mini index buffer into the larger mesh data. Meshlets can be compressed, streamed, culled, and batched much more efficiently than monolithic meshes.   # Misc * Future work: https://github.com/bevyengine/bevy/issues/11518 * Nanite reference: https://advances.realtimerendering.com/s2021/Karis_Nanite_SIGGRAPH_Advances_2021_final.pdf Two pass occlusion culling explained very well: https://medium.com/@mil_kru/two-pass-occlusion-culling-4100edcad501 --------- Co-authored-by: Ricky Taylor <rickytaylor26@gmail.com> Co-authored-by: vero <email@atlasdostal.com> Co-authored-by: François <mockersf@gmail.com> Co-authored-by: atlas dostal <rodol@rivalrebels.com>
17 lines
619 B
WebGPU Shading Language
17 lines
619 B
WebGPU Shading Language
#import bevy_core_pipeline::fullscreen_vertex_shader::FullscreenVertexOutput
|
|
|
|
@group(0) @binding(0) var input_depth: texture_2d<f32>;
|
|
@group(0) @binding(1) var samplr: sampler;
|
|
|
|
/// Performs a 2x2 downsample on a depth texture to generate the next mip level of a hierarchical depth buffer.
|
|
|
|
@fragment
|
|
fn downsample_depth(in: FullscreenVertexOutput) -> @location(0) vec4<f32> {
|
|
let depth_quad = textureGather(0, input_depth, samplr, in.uv);
|
|
let downsampled_depth = min(
|
|
min(depth_quad.x, depth_quad.y),
|
|
min(depth_quad.z, depth_quad.w),
|
|
);
|
|
return vec4(downsampled_depth, 0.0, 0.0, 0.0);
|
|
}
|