1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
//! Built-in render passes for the default pipeline.
//!
//! These passes implement [`PassNode`](super::rendergraph::PassNode) and can be used
//! directly or as references for custom pass implementations.
//!
//! # Geometry Passes
//!
//! | Pass | Description |
//! |------|-------------|
//! | [`MeshPass`] | Static mesh rendering with lighting |
//! | [`SkinnedMeshPass`] | Animated skeletal mesh rendering |
//! | [`DecalPass`] | Projected decal rendering |
//! | [`ParticlePass`] | GPU particle billboard rendering |
//! | [`ClothPass`] | GPU cloth simulation and rendering |
//! | [`TextPass`] | 3D text rendering |
//! | [`LinesPass`] | Debug line rendering |
//! | [`GridPass`] | Infinite ground grid |
//! | `GrassPass` | GPU-driven procedural grass (`grass` feature) |
//! | `TerrainPass` | Clipmap terrain with GPU height cache (`terrain` feature) |
//! | [`SceneOverlayPass`] | Grid, lines, particles, and text in one render pass |
//! | [`SkyPass`] | Procedural sky/atmosphere |
//!
//! # Paint Passes
//!
//! | Pass | Description |
//! |------|-------------|
//! | [`PaintPass`] | Batched screen-space rectangle and text rendering |
//! | [`PaintImagePass`] | Screen-space textured quad rendering |
//!
//! # Shadow Passes
//!
//! | Pass | Description |
//! |------|-------------|
//! | [`ShadowDepthPass`] | Cascaded shadow map generation |
//!
//! Shadow mapping uses 4 cascades (`NUM_SHADOW_CASCADES`) for directional lights.
//!
//! # Post-Processing Passes
//!
//! | Pass | Description |
//! |------|-------------|
//! | [`PostProcessPass`] | Final compositing with tonemapping |
//! | [`BloomPass`] | HDR bloom effect |
//! | [`SsaoPass`] | Screen-space ambient occlusion |
//! | [`SsaoBlurPass`] | SSAO blur for soft shadows |
//! | [`SsgiPass`] | Screen-space global illumination |
//! | [`SsgiBlurPass`] | SSGI bilateral blur |
//! | [`DepthOfFieldPass`] | Bokeh depth of field |
//! | `OutlinePass` | Selection outline rendering |
//! | `SelectionMaskPass` | Selection mask generation |
//! | [`BlitPass`] | Simple texture copy |
//!
//! # Using Built-in Passes
//!
//! ```ignore
//! fn configure_render_graph(
//! &mut self,
//! graph: &mut RenderGraph<World>,
//! device: &wgpu::Device,
//! surface_format: wgpu::TextureFormat,
//! resources: RenderResources,
//! ) {
//! // Add bloom post-processing
//! let bloom = BloomPass::new(device, width, height);
//! render_graph_pass(graph, Box::new(bloom))
//! .slot("hdr", resources.scene_color)
//! .slot("bloom", bloom_texture);
//!
//! // Add SSAO
//! let ssao = SsaoPass::new(device);
//! render_graph_pass(graph, Box::new(ssao))
//! .slot("depth", resources.depth)
//! .slot("view_normals", resources.view_normals)
//! .slot("ssao_raw", ssao_raw);
//!
//! let ssao_blur = SsaoBlurPass::new(device);
//! render_graph_pass(graph, Box::new(ssao_blur))
//! .slot("ssao_raw", ssao_raw)
//! .slot("depth", resources.depth)
//! .slot("view_normals", resources.view_normals)
//! .slot("ssao", ssao_final);
//!
//! // Final post-process with tonemapping
//! let postprocess = PostProcessPass::new(device, surface_format, bloom_intensity);
//! render_graph_pass(graph, Box::new(postprocess))
//! .slot("hdr", resources.scene_color)
//! .slot("bloom", bloom_texture)
//! .slot("ssao", ssao_final)
//! .slot("output", resources.swapchain);
//! }
//! ```
//!
//! # Pass Configuration
//!
//! Most passes accept configuration in their constructors:
//!
//! ```ignore
//! // Bloom with custom mip levels
//! let bloom = BloomPass::new(device, width, height);
//!
//! // SSAO (tuned at runtime via RenderInputs::settings ssao_* fields)
//! let ssao = SsaoPass::new(device);
//!
//! // Post-process with bloom intensity
//! let postprocess = PostProcessPass::new(device, format, 0.3); // 30% bloom
//! ```
/// Passes that run before the scene draws, such as pick keepalive.
pub use PickKeepalivePass;
pub use GrassPass;
pub use MeshletPass;
pub use TerrainPass;
pub use ;
/// The passes that draw a `nightshade-paint` draw list over the scene.
pub use ;
pub use ;
/// Screen-space post-processing passes: bloom, SSAO, SSGI, SSR, depth of
/// field, TAA, color grading, blit, and viewport compose.
pub use ;
pub use ;
pub use EguiPass;
/// Grows a storage buffer to hold at least `required` elements of `T`, doubling
/// the capacity so reallocation amortizes. Returns `true` when the buffer was
/// recreated, so the caller can rebuild any bind groups that referenced the old
/// buffer. No-op (returns `false`) while the current capacity already fits.