Engine API Reference - v2.24.0-beta.10
    Preparing search index...

    Class ColorLutEffect

    The color lookup table (LUT) effect, a postprocessing technique used to apply a color transformation to the image. Two LUTs are supported, which makes it easy to crossfade between two graded looks.

    Applied in display-referred space, after tone mapping, and before the vignette.

    Every CameraFrame constructs and registers one, available as CameraFrame#colorLUT.

    Hierarchy (View Summary)

    Index
    blend: number = 0

    Crossfade between the two graded results, 0-1 range. 0 shows only the primary LUT, 1 shows only the secondary LUT, intermediate values produce a linear-space mix. Only used when ColorLutEffect#texture2 is set. Defaults to 0.

    cameraFrame: CameraFrame | null = null

    The camera frame the effect is registered with, or null.

    The graphics device.

    enabled: boolean = true

    Whether the effect is enabled. An effect can additionally disable itself from its own parameters, see CameraFrameEffect#active.

    intensity: number = 1

    The strength of the primary LUT, blended against the original color, 0-1 range. Defaults to 1.

    intensity2: number = 1

    The strength of the secondary LUT, blended against the original color, 0-1 range. Only used when ColorLutEffect#texture2 is set. Defaults to 1.

    texture: Texture | null = null

    The primary LUT texture. This must be a 256×16 2D "horizontal strip" texture representing an unwrapped 16×16×16 3D LUT in Unreal Engine layout: 16 horizontal slices along the blue axis, with each slice mapping red to the X-axis and green to the Y-axis. Note that HALD LUTs (e.g. from ImageMagick) and Unity LUTs use different layouts and are not compatible. The texture must be loaded with srgb: true (LUTs are authored in sRGB display space — the Unreal / Photoshop workflow stores sRGB-encoded values indexed by sRGB-encoded coordinates), mipmaps: false (sampled at LOD 0 only), and minFilter: FILTER_LINEAR / magFilter: FILTER_LINEAR (bilinear filtering between LUT entries is required to avoid visible banding). The engine emits a debug-build warning if any of these are misconfigured. Defaults to null, making the effect disabled.

    texture2: Texture | null = null

    The optional secondary LUT texture, same format and requirements as ColorLutEffect#texture. When set, both LUTs are sampled and the two graded results are crossfaded according to ColorLutEffect#blend. Defaults to null.

    • get chunkName(): string

      Gets the name the compose chunk can be overridden under in ShaderChunks, the same way as the built-in chunks. Derived from the id as compose<Id>PS unless given.

      Returns string

    • get defineName(): string

      Gets the define set on the compose shader while the effect is active: the id in upper snake case, colorEnhance giving COLOR_ENHANCE.

      Returns string

    • get entryPoint(): string

      Gets the name of the function the composition calls at the effect's slot. Derived from the id as apply<Id> unless given. The signature depends on the slot: colour slots take (vec3 color, vec2 uv) and return the colour, COMPOSESLOT_SCENE takes and returns a vec4.

      Returns string

    • get requires(): string[]

      Gets the frame resources the effect needs, the FRAMERESOURCE_* constants - for its passes, or for its compose chunk, such as the scene depth. The camera frame provides them while the effect is active. Requirements which depend on the device are computed when constructing the effect; override this as a getter when they depend on a parameter, and the camera frame provides what it returns from the next CameraFrame#update.

      Returns string[]

    • get slot(): string | null

      Gets the compose slot the entry function is called at, or null for an effect that does not take part in the composition.

      Returns string | null

    • Destroys the effect, removing it from its camera frame if it is still registered and releasing everything it owns, the passes it created included. Subclasses which create resources in their constructor release them in an override, calling super.destroy(). The removal takes effect for the frames rendered after the next CameraFrame#update, which is due before the next frame renders.

      Returns void

    • Sets a define on the compose shader. The define persists until changed, so fixed defines can be set once in the constructor and those depending on the parameters from CameraFrameEffect#update. A value of false, null or undefined removes it. Changing a define rebuilds the compose shader.

      Parameters

      • name: string

        The define name.

      • value: any

        The value.

      Returns void