Create the albedo G-buffer (Rgba8Unorm, surface size). Written by the scene pass so post-passes can modulate bounce light by the receiving surface's diffuse albedo (SSGI etc.).
(device: &wgpu::Device, width: u32, height: u32)
| 145 | /// the scene pass so post-passes can modulate bounce light by the |
| 146 | /// receiving surface's diffuse albedo (SSGI etc.). |
| 147 | pub(super) fn create_albedo_rt(device: &wgpu::Device, width: u32, height: u32) -> (wgpu::Texture, wgpu::TextureView) { |
| 148 | let texture = device.create_texture(&wgpu::TextureDescriptor { |
| 149 | label: Some("albedo_rt"), |
| 150 | size: wgpu::Extent3d { width, height, depth_or_array_layers: 1 }, |
| 151 | mip_level_count: 1, |
| 152 | sample_count: 1, |
| 153 | dimension: wgpu::TextureDimension::D2, |
| 154 | format: wgpu::TextureFormat::Rgba8Unorm, |
| 155 | usage: wgpu::TextureUsages::RENDER_ATTACHMENT |
| 156 | | wgpu::TextureUsages::TEXTURE_BINDING, |
| 157 | view_formats: &[], |
| 158 | }); |
| 159 | let view = texture.create_view(&wgpu::TextureViewDescriptor::default()); |
| 160 | (texture, view) |
| 161 | } |
| 162 | |
| 163 | /// Create the composed HDR render target. Scene HDR + SSR + SSGI * |
| 164 | /// albedo + bloom + fog + sun shafts all merged into one texture by |