# Grass Setting

<figure><img src="https://3374031394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJZW2zR4mbZfSyHYuAIWI%2Fuploads%2FciTzEZcM9oOjBMyBblfJ%2Fimage.png?alt=media&#x26;token=9dc10bff-ca47-4397-b04e-91c2bbc50c88" alt=""><figcaption></figcaption></figure>

## VFX Property

### Grass VFX

<table><thead><tr><th width="106">Property</th><th width="140">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong>grassVfx</strong></td><td><code>VisualEffect</code></td><td>The Visual Effect component that renders the grass. All other settings are pushed to this VFX via <code>ApplyGrassSetting()</code>.</td></tr></tbody></table>

***

### Initial Settings

{% hint style="info" %}
Initial Settings only run once when the grass instantiate. The other setting could be modify at realtime
{% endhint %}

<table><thead><tr><th width="197">Property</th><th width="91">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong>maxGrassCount</strong></td><td><code>int</code></td><td>Maximum number of grass instances (0–1,000,000).</td></tr><tr><td><strong>applyGroundNormal</strong></td><td><code>bool</code></td><td>Whether to align grass to ground normals.</td></tr><tr><td><strong>grassMeshLod0</strong></td><td><code>Mesh</code></td><td>Mesh used for LOD 0.</td></tr><tr><td><strong>grassMeshLod1</strong></td><td><code>Mesh</code></td><td>Mesh used for LOD 1.</td></tr><tr><td><strong>randomSizeByNoise</strong></td><td><code>Vector2</code></td><td>Min/max scale multiplier driven by noise (X = min, Y = max).</td></tr><tr><td><strong>sizeNoiseFrequency</strong></td><td><code>float</code></td><td>Frequency of the noise used for size variation.</td></tr></tbody></table>

***

### Mesh Settings

<table><thead><tr><th width="162">Property</th><th width="110">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong>grassTexture</strong></td><td><code>Texture2D</code></td><td>Texture applied to the grass mesh.</td></tr><tr><td><strong>individualScale</strong></td><td><code>Vector3</code></td><td>Base scale per blade (X, Y, Z).</td></tr><tr><td><strong>addRandomScale</strong></td><td><code>Vector3</code></td><td>Random scale offset added per blade (X, Y, Z).</td></tr></tbody></table>

***

### Color Settings

{% hint style="info" %}
Grass color are blended with top and bottom color
{% endhint %}

#### Top Color

<table><thead><tr><th width="179">Property</th><th width="104">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong>topColorOption</strong></td><td><code>Enums</code></td><td><strong>GroundColor</strong> — from ground; <strong>Gradient</strong> — from top gradient; <strong>Noise</strong> — from top noise.</td></tr><tr><td><strong>topGradient</strong></td><td><code>Gradient</code></td><td>Gradient used when <code>topColorOption == Gradient</code>. Sampled vertically (256×256 texture).</td></tr><tr><td><strong>topNoiseFrequency</strong></td><td><code>float</code></td><td>Noise frequency for top color when option is Noise.</td></tr><tr><td><strong>topNoiseColor1</strong></td><td><code>Color</code></td><td>First color for top noise blend.</td></tr><tr><td><strong>topNoiseColor2</strong></td><td><code>Color</code></td><td>Second color for top noise blend.</td></tr></tbody></table>

#### Bottom Color

<table><thead><tr><th width="209">Property</th><th width="97">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong>bottomColorOption</strong></td><td><code>Enums</code></td><td><strong>GroundColor</strong> — from ground; <strong>Gradient</strong> — from bottom gradient; <strong>Noise</strong> — from bottom noise.</td></tr><tr><td><strong>bottomGradient</strong></td><td><code>Gradient</code></td><td>Gradient used when <code>bottomColorOption == Gradient</code>. Sampled vertically (256×256).</td></tr><tr><td><strong>bottomNoiseFrequency</strong></td><td><code>float</code></td><td>Noise frequency for bottom color when option is Noise.</td></tr><tr><td><strong>bottomNoiseColor1</strong></td><td><code>Color</code></td><td>First color for bottom noise blend.</td></tr><tr><td><strong>bottomNoiseColor2</strong></td><td><code>Color</code></td><td>Second color for bottom noise blend.</td></tr></tbody></table>

***

### Wind Settings

<table><thead><tr><th width="204">Property</th><th width="98">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong>windDirection</strong></td><td><code>Vector2</code></td><td>Wind direction (X, Z in world space).</td></tr><tr><td><strong>windDensity</strong></td><td><code>float</code></td><td>Density/turbulence of wind.</td></tr><tr><td><strong>windSpeed</strong></td><td><code>float</code></td><td>Wind animation speed.</td></tr><tr><td><strong>windStrength</strong></td><td><code>float</code></td><td>Wind bend strength (0–2).</td></tr><tr><td><strong>windSmoothless</strong></td><td><code>float</code></td><td>Wind smoothing (0–5).</td></tr><tr><td><strong>windHighlightOption</strong></td><td><code>Enums</code></td><td><strong>Simple</strong> — default highlight; <strong>CustomColor</strong> — use <strong>windHighlightColor</strong>.</td></tr><tr><td><strong>windHighlightColor</strong></td><td><code>Color</code></td><td>Highlight color when <code>windHighlightOption == CustomColor</code>.</td></tr><tr><td><strong>windHighlightStrength</strong></td><td><code>float</code></td><td>Intensity of wind highlight (0–200).</td></tr></tbody></table>

***

### Motion Settings

<table><thead><tr><th width="148">Property</th><th width="85">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong>motionStrength</strong></td><td><code>float</code></td><td>General motion/bend strength for the grass.</td></tr></tbody></table>

***

### Enums

* **TopColorOption / BottomColorOption:** `GroundColor` (0), `Gradient` (1), `Noise` (2).
* **WindHighlightOption:** `Simple` (0), `CustomColor` (1).

***

### VFX Property Names (Reference)

These names are passed to `grassVfx.Set*()` and must match the VFX Graph exposed properties:

* **Initial:** `MaxGrassCount`, `ApplyGroundNormal`, `MeshLod0`, `MeshLod1`, `RandomSizeByNoise`, `SizeNoiseFrequency`
* **Mesh:** `IndividualScale`, `AddRandomScale`, `GrassTexture`
* **Top color:** `TopColorOption`, `TopGradientTexture`, `TopNoiseFrequency`, `TopNoiseColor1`, `TopNoiseColor2`
* **Bottom color:** `BottomColorOption`, `BottomGradientTexture`, `BottomNoiseFrequency`, `BottomNoiseColor1`, `BottomNoiseColor2`
* **Wind:** `WindDirection`, `WindDensity`, `WindSpeed`, `WindStrength`, `WindSmoothless`, `WindHighlightOption`, `WindHighlightColor`, `WindHighlightStrength`
* **Motion:** `MotionStrength`
