Luxar Viewer API Documentation - v2026.9.22
    Preparing search index...

    Function coerceScalarsToFloat32

    • 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.

      Parameters

      • scalars:
            | Uint8Array<ArrayBufferLike>
            | Float32Array<ArrayBufferLike>
            | Float16Array<ArrayBufferLike>

      Returns Float32Array