Halton low-discrepancy sequence (base `b`, index `i`, 1-based). Returns a value in [0, 1). Used to generate sub-pixel jitter offsets that are well-distributed across the pixel — the TAA accumulation effectively integrates over those sample points to produce a stably anti-aliased image.
(mut i: u32, b: u32)
| 590 | /// accumulation effectively integrates over those sample points |
| 591 | /// to produce a stably anti-aliased image. |
| 592 | pub(super) fn halton(mut i: u32, b: u32) -> f32 { |
| 593 | let mut f = 1.0_f32; |
| 594 | let mut r = 0.0_f32; |
| 595 | while i > 0 { |
| 596 | f /= b as f32; |
| 597 | r += f * (i % b) as f32; |
| 598 | i /= b; |
| 599 | } |
| 600 | r |
| 601 | } |
| 602 | |
| 603 | /// Create the two TAA history textures (HDR format, surface size). |
| 604 | pub(super) fn create_taa_textures(device: &wgpu::Device, width: u32, height: u32) -> ([wgpu::Texture; 2], [wgpu::TextureView; 2]) { |
no outgoing calls
no test coverage detected