MCPcopy Create free account
hub / github.com/Bloom-Engine/engine / create_ssr_rt

Function create_ssr_rt

native/shared/src/renderer/formats.rs:210–226  ·  view source on GitHub ↗

Create the SSR render target (quarter-res HDR). Stochastic SSR traces one GGX-sampled ray per pixel per frame and relies on the temporal denoiser to converge the cone over 4–8 frames; pushing from half to quarter-res cuts the march + temporal-filter pixel counts 4× and the bilinear upsample in compose is imperceptible because the GGX cone + temporal blend is already wider than one quarter-res texe

(device: &wgpu::Device, width: u32, height: u32)

Source from the content-addressed store, hash-verified

208/// because the GGX cone + temporal blend is already wider than one
209/// quarter-res texel.
210pub(super) fn create_ssr_rt(device: &wgpu::Device, width: u32, height: u32) -> (wgpu::Texture, wgpu::TextureView) {
211 let w = (width / 4).max(1);
212 let h = (height / 4).max(1);
213 let texture = device.create_texture(&wgpu::TextureDescriptor {
214 label: Some("ssr_rt"),
215 size: wgpu::Extent3d { width: w, height: h, depth_or_array_layers: 1 },
216 mip_level_count: 1,
217 sample_count: 1,
218 dimension: wgpu::TextureDimension::D2,
219 format: HDR_FORMAT,
220 usage: wgpu::TextureUsages::RENDER_ATTACHMENT
221 | wgpu::TextureUsages::TEXTURE_BINDING,
222 view_formats: &[],
223 });
224 let view = texture.create_view(&wgpu::TextureViewDescriptor::default());
225 (texture, view)
226}
227
228/// Create the SSR temporal history textures (ping-pong pair, same
229/// format/size as ssr_rt — half-res HDR). The temporal denoiser

Callers 2

newMethod · 0.85
resizeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected