# GetClippedPixelRectInRenderTexturePixels(int)

> Retrieves the clipped pixel rectangle for a Terrain, relative to the PaintContext render textures.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine.TerrainTools](/engine/6000.6/script-reference/unityengine/terraintools.md)
* **Assembly:** UnityEngine.TerrainModule

```csharp
public RectInt GetClippedPixelRectInRenderTexturePixels(int terrainIndex)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Index of the Terrain.

### Returns

| Type                                                              | Description                          |
| ----------------------------------------------------------------- | ------------------------------------ |
| [RectInt](/engine/6000.6/script-reference/unityengine/rectint.md) | Returns the clipped pixel rectangle. |

### Remarks

When painting across a border, the PaintContext can refer to several Terrain tiles. GetClippedPixelRectInTerrainPixels returns the [PaintContext.pixelRect](/engine/6000.6/script-reference/unityengine/terraintools/paintcontext/pixelrect.md) clipped to the specified Terrain, in the pixel coordinates of [PaintContext.sourceRenderTexture](/engine/6000.6/script-reference/unityengine/terraintools/paintcontext/sourcerendertexture.md) and [PaintContext.destinationRenderTexture](/engine/6000.6/script-reference/unityengine/terraintools/paintcontext/destinationrendertexture.md). terrainIndex must be between 0 and [PaintContext.terrainCount](/engine/6000.6/script-reference/unityengine/terraintools/paintcontext/terraincount.md) - 1. Additional Resources: [PaintContext.GetTerrain](/engine/6000.6/script-reference/unityengine/terraintools/paintcontext/getterrain.md).
