# GetBlendShapeBuffer

> Retrieves a GraphicsBuffer that provides direct read and write access to GPU blend shape vertex data.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine](/engine/6000.5/script-reference/unityengine.md)
* **Assembly:** UnityEngine.CoreModule

## GetBlendShapeBuffer(BlendShapeBufferLayout)

Retrieves a [GraphicsBuffer](/engine/6000.5/script-reference/unityengine/graphicsbuffer.md) that provides direct read and write access to GPU blend shape vertex data.

```csharp
public GraphicsBuffer GetBlendShapeBuffer(BlendShapeBufferLayout layout)
```

### Parameters

**** (\[BlendShapeBufferLayout]\(/engine/6000.5/script-reference/unityengine/rendering/blendshapebufferlayout)): The buffer to access. The default value is [BlendShapeBufferLayout.PerShape](/engine/6000.5/script-reference/unityengine/rendering/blendshapebufferlayout/pershape.md).

### Returns

| Type                                                                            | Description                                                                                                                                                  |
| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [GraphicsBuffer](/engine/6000.5/script-reference/unityengine/graphicsbuffer.md) | The blend shape vertex data as a [GraphicsBuffer](/engine/6000.5/script-reference/unityengine/graphicsbuffer.md), or null if the sprite has no blend shapes. |

### Remarks

The buffer that this method returns is called the blend shape buffer. It contains blend shape vertices, which the GPU uses to deform the sprite mesh into blend shapes.

There are two blend shape buffers that you can access. They use different layout patterns, and contain slightly different data. For more information, refer to [BlendShapeBufferLayout.PerShape](/engine/6000.5/script-reference/unityengine/rendering/blendshapebufferlayout/pershape.md) and [BlendShapeBufferLayout.PerVertex](/engine/6000.5/script-reference/unityengine/rendering/blendshapebufferlayout/pervertex.md). Compute shader support is required to access this buffer.

The version of this method that takes no parameter is equivalent to calling it with [BlendShapeBufferLayout.PerShape](/engine/6000.5/script-reference/unityengine/rendering/blendshapebufferlayout/pershape.md) as the argument.

After using this buffer, you should dispose of it.

## GetBlendShapeBuffer()

Retrieves a [GraphicsBuffer](/engine/6000.5/script-reference/unityengine/graphicsbuffer.md) that provides direct read and write access to GPU blend shape vertex data.

```csharp
public GraphicsBuffer GetBlendShapeBuffer()
```

### Returns

| Type                                                                            | Description                                                                                                                                                  |
| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [GraphicsBuffer](/engine/6000.5/script-reference/unityengine/graphicsbuffer.md) | The blend shape vertex data as a [GraphicsBuffer](/engine/6000.5/script-reference/unityengine/graphicsbuffer.md), or null if the sprite has no blend shapes. |

### Remarks

The buffer that this method returns is called the blend shape buffer. It contains blend shape vertices, which the GPU uses to deform the sprite mesh into blend shapes.

There are two blend shape buffers that you can access. They use different layout patterns, and contain slightly different data. For more information, refer to [BlendShapeBufferLayout.PerShape](/engine/6000.5/script-reference/unityengine/rendering/blendshapebufferlayout/pershape.md) and [BlendShapeBufferLayout.PerVertex](/engine/6000.5/script-reference/unityengine/rendering/blendshapebufferlayout/pervertex.md). Compute shader support is required to access this buffer.

The version of this method that takes no parameter is equivalent to calling it with [BlendShapeBufferLayout.PerShape](/engine/6000.5/script-reference/unityengine/rendering/blendshapebufferlayout/pershape.md) as the argument.

After using this buffer, you should dispose of it.
