# GetVertexBuffer()

> Retrieves direct access to this renderer's deformed vertex data for the current frame.

## Definition

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

```csharp
public GraphicsBuffer GetVertexBuffer()
```

### Returns

| Type                                                                            | Description                                                                                        |
| ------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
| [GraphicsBuffer](/engine/6000.7/script-reference/unityengine/graphicsbuffer.md) | The current frame's deformed vertex buffer. If Unity hasn't deformed the mesh yet, returns `null`. |

### Remarks

Use this method to retrieve the deformed vertex buffer for the current frame. Deformed vertex data is the vertex data after Unity applies skinning and blend shapes. If Unity hasn't deformed the mesh yet, no vertex buffer exists and this method returns null.

If the buffer has a target that allows compute access, such as [GraphicsBuffer.Target.Raw](/engine/6000.7/script-reference/unityengine/graphicsbuffer/target/raw.md) or [GraphicsBuffer.Target.Structured](/engine/6000.7/script-reference/unityengine/graphicsbuffer/target/structured.md), you can use it to access the current frame's deformed vertex data in a [ComputeShader](/engine/6000.7/script-reference/unityengine/computeshader.md) or another shader. When Unity deforms the mesh on the GPU, the buffer already has such a target; otherwise, request one with [SkinnedMeshRenderer.vertexBufferTarget](/engine/6000.7/script-reference/unityengine/skinnedmeshrenderer/vertexbuffertarget.md) or [EditorGraphicsSettings.defaultMeshBufferTarget](/engine/6000.7/script-reference/unityeditor/rendering/editorgraphicssettings/defaultmeshbuffertarget.md). Bind the buffer as a shader parameter by using [ComputeShader.SetBuffer](/engine/6000.7/script-reference/unityengine/computeshader/setbuffer.md), [Material.SetBuffer](/engine/6000.7/script-reference/unityengine/material/setbuffer.md), or a similar method.

Additional Resources: [SkinnedMeshRenderer.vertexBufferTarget](/engine/6000.7/script-reference/unityengine/skinnedmeshrenderer/vertexbuffertarget.md), [SkinnedMeshRenderer.GetPreviousVertexBuffer](/engine/6000.7/script-reference/unityengine/skinnedmeshrenderer/getpreviousvertexbuffer.md).
