Skip to main content

compose_into

Function compose_into 

Source
pub fn compose_into(
    shared_fb: &mut [u32],
    shared_zb: &mut [f32],
    temp_fb: &[u32],
    temp_zb: &[f32],
)
Expand description

Per-pixel “min-z wins” merge of (temp_fb, temp_zb) into (shared_fb, shared_zb).

Voxlap’s z-buffer convention: z = perpendicular distance from camera; smaller z = closer to camera. This helper picks the closer pixel per slot. Sky pixels emerge with a large z (scratch.skycast.dist, set to gxmax or i32::MAX per phase_startsky) so they always lose to any hit’s finite distance.

temp_fb / temp_zb are read-only inputs; both must have the same length as shared_fb / shared_zb (debug-asserted).