Skip to main content

pack

Function pack 

Source
pub fn pack(table: &IfsTable) -> IfsPacked
Expand description

Lay a resolved table out for the uniform, recomposing each map and accumulating the probabilities.

The accumulation is deliberately not renormalized here: a table whose probabilities do not sum to 1 would leave the last cumulative entry short of it, and the shader’s else arm would then absorb the shortfall into the fourth map. Forcing the final entry to 1.0 states that outright rather than letting a rounding residue decide.