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

Function halton

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

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)

Source from the content-addressed store, hash-verified

590/// accumulation effectively integrates over those sample points
591/// to produce a stably anti-aliased image.
592pub(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).
604pub(super) fn create_taa_textures(device: &wgpu::Device, width: u32, height: u32) -> ([wgpu::Texture; 2], [wgpu::TextureView; 2]) {

Callers 2

end_frame_with_sceneMethod · 0.85
begin_mode_3dMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected