Skip to main content

band_contour_style

Function band_contour_style 

Source
pub fn band_contour_style(style: f32) -> f32
Expand description

The contour style the sample sites are handed: clamped into [0, MAX_PALETTE_CONTOUR_STYLE] and rounded to an integer, with a non-finite binding falling back to the soft darkening.

The rounding is what lets the WGSL compare the style for equality — style == 1.0 — rather than bracketing it, which would mean deciding what 1.5 means at six sites instead of one. It is band_steps’ treatment for band_steps’ reason: [smoothing] and preset dissolves sweep a binding continuously between two settings, and this is a selector rather than an amount.

It clamps where echo_orientation wraps, because the four styles are two independent flags rather than a cycle: counting past 3 means asking for a harder, inkier line than exists, and landing back on the soft black one would be a surprise rather than a rotation.