# Class: ShaderOverrides

**`Advanced`**

A specialized class that handles the caching and identification of shader overrides.
Shader overrides are used to inject constants into a shader pipeline, allowing for
powerful customization without the need for recompiling the shader source.

This class ensures that override configurations are unique and immutable, allowing
the renderer to efficiently cache pipelines based on these configurations.

## Constructors

### Constructor

> **new ShaderOverrides**(`data`): `ShaderOverrides`

#### Parameters

##### data

[`Record`](https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type)\<`string`, `number`\>

A dictionary of constants to set on the shader.
Keys should match the constant names in the WGSL shader.

#### Returns

`ShaderOverrides`

## Properties

### data

> `readonly` **data**: [`Record`](https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type)\<`string`, `number`\>

The dictionary of constants to override.

***

### id

> `readonly` **id**: `number`

The unique ID of the override configuration. Used for efficient caching.

## Methods

### from()

> `static` **from**(`overrides`): `ShaderOverrides`

Creates a ShaderOverrides instance from a plain object or existing instance.

#### Parameters

##### overrides

The overrides to convert.

[`Record`](https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type)\<`string`, `number`\> | `ShaderOverrides`

#### Returns

`ShaderOverrides`

A ShaderOverrides instance.
