Function createTexture3DFromPixels
-
createTexture3DFromPixels(
engine: EngineContext,
data: Uint8Array,
width: number,
height: number,
depth: number,
options?: PixelsTexture3DOptions,
): Texture3DParameters
- engine: EngineContext
Engine context.
- data: Uint8Array
width * height * depth * 4bytes, 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
- engine: EngineContext
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 singletextureSample.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 intosetEffectTexture) with an extradepthfield; itsviewis created withdimension:"3d".