# TaaEffect

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

Source: https://github.com/playcanvas/engine/blob/64089771243fe28a9b9d2b4de538b99b07c75097/src/extras/effects/taa/taa-effect.js#L24

The temporal anti-aliasing (TAA) effect, a technique used to reduce aliasing in the rendered
image by blending multiple frames together over time. The camera is offset by a different
fraction of a pixel every frame, and each frame is accumulated into a history, reprojected using
the scene depth to follow the motion of the camera.

The effect resolves the scene before the other effects read it, so that the depth of field, the
bloom and the composition all work with the anti-aliased scene. It can also upscale a scene
rendered at a lower resolution, see [TaaEffect#upscale](https://api.playcanvas.com/engine/classes/TaaEffect.md#upscale).

Every [CameraFrame](https://api.playcanvas.com/engine/classes/CameraFrame.md) constructs and registers one, available as [CameraFrame#taa](https://api.playcanvas.com/engine/classes/CameraFrame.md#taa).

## Constructors

### constructor

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

**Parameters**

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

## Properties

### enabled

```ts
enabled: boolean = false
```

Whether TAA is enabled. Defaults to false.

### jitter

```ts
jitter: number = 1
```

The intensity of the camera jitter, 0-1 range. The larger the value, the more jitter is
applied to the camera, making the anti-aliasing effect more pronounced. This also makes the
image more blurry, and rendering.sharpness parameter of the [CameraFrame](https://api.playcanvas.com/engine/classes/CameraFrame.md) can be used
to counteract. Defaults to 1.

### upscale

```ts
upscale: boolean = false
```

Whether TAA accumulates the frames rendered at a lower resolution, see
rendering.renderTargetScale of the [CameraFrame](https://api.playcanvas.com/engine/classes/CameraFrame.md), at the full resolution - the jitter
placing their samples at different positions within the full resolution pixels, which
recovers detail lost to the lower resolution. Moving objects can blur or ghost more than with
TAA alone, as the history is relied on for longer while upscaling. Defaults to false.

## 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`
- `get active(): boolean`
- `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`
- `destroy(): void`
- `frameUpdate(frame: CameraFrameEffectContext): void`
- `getChunk(shaderLanguage: string): string | null`
- `setDefine(name: string, value: any): void`
- `setUniform(name: string, value: number | number[] | ArrayBufferView<ArrayBufferLike> | Texture): void`
