# DirtyTextureRegion(string, RectInt, bool)

> Marks the specified part of the Terrain texture as dirty.

## Definition

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

```csharp
public void DirtyTextureRegion(string textureName, RectInt region, bool allowDelayedCPUSync)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The name of the Terrain texture.**** (\[RectInt]\(/engine/6000.7/script-reference/unityengine/rectint)): The rectangular region to mark as dirty.**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): Specifies whether to allow delayed CPU synchronization of the texture.

### Remarks

Use this function only after you manually change the GPU part of the Terrain texture, such as by using [Graphics.CopyTexture](/engine/6000.7/script-reference/unityengine/graphics/copytexture.md). Set the `allowDelayedCPUSync` parameter to `true` if you want Unity to perform immediate synchronization of the CPU part. If you set it to `false`, Unity queues the reading back of the dirty region until the next call to [TerrainData.SyncTexture](/engine/6000.7/script-reference/unityengine/terraindata/synctexture.md).

If the current active [RenderTexture](/engine/6000.7/script-reference/unityengine/rendertexture.md) contains your changes, and you want to copy a part of it into the Terrain texture, use [TerrainData.CopyActiveRenderTextureToTexture](/engine/6000.7/script-reference/unityengine/terraindata/copyactiverendertexturetotexture.md) instead.
