API

Function createTexture3DFromPixels

  • Create a 3D texture from a tightly-packed RGBA8 byte buffer — the volumetric analog of createTexture2DFromPixels. The primary use is a colour-grading LUT (a .cube/HALD colour cube): upload the N×N×N RGBA volume once and sample it trilinearly with a single textureSample.

    The default sampler is linear with clamp-to-edge on all three axes — exactly what a LUT wants (linear = trilinear interpolation between grid points; clamp = no wrap at the cube faces). The returned handle is a Texture2D (so it drops straight into setEffectTexture) with an extra depth field; its view is created with dimension:"3d".

    Parameters

    • engine: EngineContext

      Engine context.

    • data: Uint8Array

      width * height * depth * 4 bytes, RGBA8, ordered x fastest, then y, then z (slice-major).

    • width: number

      Cube size along R (>= 1).

    • height: number

      Cube size along G (>= 1).

    • depth: number

      Cube size along B (>= 1).

    • options: PixelsTexture3DOptions = {}

      Sampler / format overrides.

    Returns Texture3D