# ShaderChunks

Class · category: Graphics

Source: https://github.com/playcanvas/engine/blob/970d89f6d3bc6667f4e1f88153abd6e7e82ed52c/src/scene/shader-lib/shader-chunks.js#L18

A collection of GLSL and WGSL shader chunks, used to generate shaders.

## Properties

### version

```ts
version: string = ''
```

Specifies the API version of the shader chunks.

This should be a string containing the current engine major and minor version (e.g., '2.8'
for engine v2.8.1) and ensures compatibility with the current engine version. When providing
custom shader chunks, set this to the latest supported version. If a future engine release no
longer supports the specified version, a warning will be issued. In that case, update your
shader chunks to match the new format and set this to the latest version accordingly.

## Methods

### get

```ts
static get(device: GraphicsDevice, shaderLanguage?: string): ShaderChunkMap
```

Returns a shader chunks map for the given device and shader language.

**Parameters**

- `device` ([`GraphicsDevice`](https://api.playcanvas.com/engine/classes/GraphicsDevice.md)): The graphics device.
- `shaderLanguage` (`string`, optional, default `SHADERLANGUAGE_GLSL`): The shader language to use (GLSL or WGSL).

**Returns** [`ShaderChunkMap`](https://api.playcanvas.com/engine/classes/ShaderChunkMap.md): The shader chunks for the specified language.
