# ExportGrassAtlasTexture

### Export Grass Atlas Texture

```csharp
Texture2D ExportGrassAtlasTexture(int resolution, out Dictionary<Texture2D, Rect> atlasRect)
```

Packs all textures used by the grass objects stored inside [TerrainData](https://docs.unity3d.com/ScriptReference/TerrainData.html) object into a texture atlas.

*<mark style="color:blue;">atlasRect</mark>*  - Returns an array of rectangles containing the UV coordinates of each packed grass texture inside atlas, or null if packing fails.

The resulting texture atlas will be as large as needed to fit all grass textures but only up to *<mark style="color:blue;">resolution</mark>* in each dimension. If the grass textures can't all fit into a texture atlas of the desired size then they will be scaled down to fit.
