# Performance Settings

The following settings do not cause a recompile of the shader, unlike [shader variants](https://docs.stixgames.com/general/material-settings/shader-variants), but they still have an extreme performance impact.

## **Density Settings**

The 4 density settings are the single most important settings in regards to performance and visual appearance.

* **Target Density**: This setting represents the maximum density of your grass. You should use the highest value where the material still looks good, in order to improve performance.
* **Density Falloff Start**: The distance after which grass density will start to decrease. Everything between the camera and this distance will have exactly the **Target Density**.
* **Density Falloff Scale**: Scales the falloff speed linearly. A higher value causes the density to decrease more quickly.
* **Density Falloff Power**: Scales the falloff speed non-linearly. A higher value increases the speed at which density increases.

{% hint style="info" %}
The density falloff scales like this: $$(s d)^p$$, where $$s$$ is the scale, $$d$$ is the distance from the falloff start, and $$p$$ is the falloff power.
{% endhint %}

{% hint style="warning" %}
Don't use **Target Density** like an arbitrary slider. It should represent a specific maximum density. You should use a mesh with sufficient polygon density (or use mesh normalization on the mesh filter) and select a value that represents the density you want for your scene. When you follow this rule, you will prevent artifacts, make the material more predictable, and improve your visual appearance.
{% endhint %}

{% tabs %}
{% tab title="Low target density" %}

<figure><img src="https://3126883291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOPt0L4TK5w89cb0ZVIqr%2Fuploads%2FbzO0oUvg1SOcrgakihKg%2FGrassLowTargetDensity.png?alt=media&#x26;token=bc72d15f-8c98-497a-8b64-ad4f461dc57a" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="High target density" %}

<figure><img src="https://3126883291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOPt0L4TK5w89cb0ZVIqr%2Fuploads%2Fz1BIxeyzkRVWGvXp09Fu%2FGrassInvertedPBR.png?alt=media&#x26;token=f34271a0-e50f-45bb-ad22-56beb506ebe5" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Low falloff start" %}

<figure><img src="https://3126883291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOPt0L4TK5w89cb0ZVIqr%2Fuploads%2Fo99uYgkkJpskAYpv8NuX%2FGrasslowFalloffStart.png?alt=media&#x26;token=996cb138-b15d-42ae-b14d-84c0a6f0cf0e" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="High falloff start" %}

<figure><img src="https://3126883291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOPt0L4TK5w89cb0ZVIqr%2Fuploads%2F92Fn4SGYXneIkjOrPr4t%2FGrassHighFalloffStart.png?alt=media&#x26;token=20c02a9b-82bf-47b0-9430-02111ddfdca4" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="High falloff scale" %}

<figure><img src="https://3126883291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOPt0L4TK5w89cb0ZVIqr%2Fuploads%2FNP8MQNjNKLw4GXd9qIOB%2FGrassHighFalloffScale.png?alt=media&#x26;token=f759e007-f82f-4edf-8920-d690821e0e78" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Low falloff scale" %}

<figure><img src="https://3126883291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOPt0L4TK5w89cb0ZVIqr%2Fuploads%2Fpeem6Ehnm6SZl0nhbVaP%2FGrassLowFalloffScale.png?alt=media&#x26;token=d9c5f2c2-b0ed-4039-8e6d-52a1e80177c6" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="High falloff power" %}

<figure><img src="https://3126883291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOPt0L4TK5w89cb0ZVIqr%2Fuploads%2FlXRhTRKWJtrP8dC1q43g%2FGrassHighFalloffPower.png?alt=media&#x26;token=fd121b84-d8c0-4b13-8235-749d83e46a50" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Low falloff power" %}

<figure><img src="https://3126883291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOPt0L4TK5w89cb0ZVIqr%2Fuploads%2Fz1BIxeyzkRVWGvXp09Fu%2FGrassInvertedPBR.png?alt=media&#x26;token=f34271a0-e50f-45bb-ad22-56beb506ebe5" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}

## **LOD Settings**

These settings change how many polygons are used per blade of grass. This can be used to improve performance.

## **Fade Settings**

These settings define at which distance the grass starts to fade into the ground. All blades of grass further away than **Grass Fade End** will not be rendered at all, which improves performance.
