# ColorLutEffect

Class · extends [`CameraFrameEffect`](https://api.playcanvas.com/engine/classes/CameraFrameEffect.md) · category: Graphics

Source: https://github.com/playcanvas/engine/blob/64089771243fe28a9b9d2b4de538b99b07c75097/src/extras/effects/color-lut/color-lut-effect.js#L37

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](https://api.playcanvas.com/engine/classes/CameraFrame.md) constructs and registers one, available as [CameraFrame#colorLUT](https://api.playcanvas.com/engine/classes/CameraFrame.md#colorlut).

## Constructors

### constructor

```ts
new ColorLutEffect(device: GraphicsDevice)
```

**Parameters**

- `device` ([`GraphicsDevice`](https://api.playcanvas.com/engine/classes/GraphicsDevice.md)): The graphics device.

## Properties

### blend

```ts
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](https://api.playcanvas.com/engine/classes/ColorLutEffect.md#texture2) is set. Defaults to 0.

### intensity

```ts
intensity: number = 1
```

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

### intensity2

```ts
intensity2: number = 1
```

The strength of the secondary LUT, blended against the original color, 0-1 range. Only
used when [ColorLutEffect#texture2](https://api.playcanvas.com/engine/classes/ColorLutEffect.md#texture2) is set. Defaults to 1.

### texture

```ts
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

```ts
texture2: Texture | null = null
```

The optional secondary LUT texture, same format and requirements as
[ColorLutEffect#texture](https://api.playcanvas.com/engine/classes/ColorLutEffect.md#texture). When set, both LUTs are sampled and the two graded results
are crossfaded according to [ColorLutEffect#blend](https://api.playcanvas.com/engine/classes/ColorLutEffect.md#blend). Defaults to null.

## Accessors

### active

```ts
get active(): boolean
```

Gets whether the effect contributes to the frame. It is disabled until a
[ColorLutEffect#texture](https://api.playcanvas.com/engine/classes/ColorLutEffect.md#texture) is assigned.

## Methods

### update

```ts
update(): void
```

Applies the effect's parameters. Called by [CameraFrame#update](https://api.playcanvas.com/engine/classes/CameraFrame.md#update) while the effect is
active: set the uniform values with [CameraFrameEffect#setUniform](https://api.playcanvas.com/engine/classes/CameraFrameEffect.md#setuniform) here, and the
defines which depend on the parameters.
Everything it sets is what the frames rendered until the next update use.

## Inherited from [CameraFrameEffect](https://api.playcanvas.com/engine/classes/CameraFrameEffect.md)

- `cameraFrame: CameraFrame | null = null`
- `device: GraphicsDevice`
- `enabled: boolean = true`
- `get cameraExposureScale(): number`
- `get chunkName(): string`
- `get debugViews(): string[]`
- `get defineName(): string`
- `get entryPoint(): string`
- `get glsl(): string | null`
- `get id(): string`
- `get requires(): string[]`
- `get slot(): string | null`
- `get wgsl(): string | null`
- `buildKey(): string`
- `createPasses(resources: CameraFrameEffectResources, passes: CameraFrameEffectPasses): void`
- `destroy(): void`
- `destroyPasses(): void`
- `frameUpdate(frame: CameraFrameEffectContext): void`
- `getChunk(shaderLanguage: string): string | null`
- `resolveScene(scene: CameraFrameEffectScene): void`
- `setDefine(name: string, value: any): void`
- `setUniform(name: string, value: number | number[] | ArrayBufferView<ArrayBufferLike> | Texture): void`
