Coerce a per-vertex scalar buffer (ScalarArray) to Float32 so the
WASM interpolate_scalars_batch kernel can consume it.
Float32Array passes through unchanged (zero copy).
Float16Array is expanded element-wise (Float16Array's element
accessor returns a JS number, so a simple copy through a new
Float32Array is correct).
Uint8Array is normalized by 1/255 to match the colormap
shader's [0, 1] scalar contract (consistent with how Points
handles its uint8 scalar attribute via radiusScale = 1/255).
Float16 is not normalized: it's already a real-valued scalar in
whatever range the dataset author chose. The shader's
uScalarMin/uScalarScale uniforms perform the LUT remapping.
Coerce a per-vertex scalar buffer (
ScalarArray) to Float32 so the WASMinterpolate_scalars_batchkernel can consume it.Float32Arraypasses through unchanged (zero copy).Float16Arrayis expanded element-wise (Float16Array's element accessor returns a JSnumber, so a simple copy through a new Float32Array is correct).Uint8Arrayis normalized by1/255to match the colormap shader's[0, 1]scalar contract (consistent with how Points handles its uint8 scalar attribute viaradiusScale = 1/255).Float16 is not normalized: it's already a real-valued scalar in whatever range the dataset author chose. The shader's
uScalarMin/uScalarScaleuniforms perform the LUT remapping.