• Encodes Float32 RGBA pixel data as a Radiance HDR (.hdr) ArrayBuffer, suitable for hand-off to IBL.setEnvironmentHDRBuffer.

    Emits the uncompressed RGBE form (no adaptive-RLE markers); standard .hdr parsers fall back to that path when the RLE marker is absent, which keeps the encoder small. The cost is roughly 2× the bytes of the RLE form — irrelevant for in-memory use, where nothing touches disk.

    Pixels are read in row-major, top-down order. Alpha is ignored.

    Parameters

    • pixels: number[] | Float32Array<ArrayBufferLike>

      Float32 RGBA pixel data, width * height * 4 floats.

    • width: number

      Pixel width.

    • height: number

      Pixel height.

    Returns ArrayBuffer

    Radiance HDR file bytes as an ArrayBuffer.