• Quantises a single RGB colour from normalised [0..1] floats into the [0..255] byte range, returning the result in a caller-supplied dest (allocates if omitted).

    This is the conversion the WebGL renderer applies before writing into its RGBA8UI per-view attribute texture. Centralising it here keeps the convention in one place — both the initial-upload path (viewing!webGLRenderer.internal.GPUMemoryBatch | GPUMemoryBatch) and the colour-change / colorize-clear paths (viewing!webGLRenderer.internal.RendererMesh | RendererMesh) agree on it.

    Differences from compressRGBColors:

    • Operates on a single Vec3 rather than a flat [r,g,b, r,g,b, …] array.
    • Writes into dest instead of allocating a fresh typed array — safe to call from the hot render path.
    • Uses Math.floor, matching the original renderer convention (compressRGBColors rounds, which would disagree at 0.5-boundary values).
    • Does not throw on out-of-range input — the bottom byte simply wraps. Callers who care should clamp upstream.

    Parameters

    Returns Vec3