# Tutorial #2 - Particles

In the previous chapter we have created a texture blending shader using DRM node for achieving snow effect. We will extend that scene with snow particles now.

If continuing from the previous scene, you can skip block below.

<details>

<summary>Setting up empty snow scene</summary>

&#x20;Just to make sure that the scene is correctly setup:

1. Add any mesh to a scene and assign materials with snow shader created in the previous chapter.
2. Add **DRM Controller** script to a scene and add snow material to its **Materials** array:

<figure><img src="https://1494537888-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVDsGRBXgFisq0hO6tTXv%2Fuploads%2F0xffkp3NKAkc0iVZjV36%2F8.png?alt=media&#x26;token=d7883475-c047-42ba-b67e-a9a8752fe133" alt=""><figcaption></figcaption></figure>

3. **DRM Settings** in the **DRM Controller** script must be the same as the DRM node used in Snow material. For selecting proper **DRM Settings** and to make sure they are the same as the DRM node inside material, use the **Load** menu that allows easy selection of DRM settings from  **Materials** array or all scene materials:

<figure><img src="https://1494537888-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVDsGRBXgFisq0hO6tTXv%2Fuploads%2FEbvjxNefvXjGWIaR0MjL%2F3.gif?alt=media&#x26;token=a3bebbf9-9982-41de-9245-184f09bd383c" alt="" width="462"><figcaption></figcaption></figure>

4. Create **DRM Game Object** and add it to the **DRM Game Objects** array in the **DRM Controller**.

If everything is setup correctly, then adjusting mask properties inside the **DRM Game Object** should be affecting snow material in the scene.

</details>

Create a new shader for snow particles:

{% stepper %}
{% step %}
Create a new **Shader Graph** file and make it Unlit, Transparent and Additive:

<figure><img src="https://1494537888-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVDsGRBXgFisq0hO6tTXv%2Fuploads%2FojOxOoiXIctEtgnWnprT%2F10.png?alt=media&#x26;token=5eddb9f1-8037-41c5-8c88-1029f70af3fc" alt="" width="247"><figcaption></figcaption></figure>
{% endstep %}

{% step %}
Duplicate DRM node from the snow shader, or open DRM editor window, select the same settings there as used by the **DRM Controller** script and click on the **Shader Graph** button <img src="https://1494537888-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVDsGRBXgFisq0hO6tTXv%2Fuploads%2FsUDUkiD5QJrFEnXXATge%2F33.png?alt=media&#x26;token=bdee03f9-f398-4d67-b6f5-7b05275878d1" alt="" data-size="line"> to find required DRM node and drag & drop it inside particle shader. Connect particle texture to **Base Color** and DRM node output to the **Alpha**:

<figure><img src="https://1494537888-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVDsGRBXgFisq0hO6tTXv%2Fuploads%2Fq1ryd3GZ0tOi3wCFjn3u%2F11.png?alt=media&#x26;token=a8d6ef84-4395-4d43-80bb-30cce46efcd5" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
Create particle system and adjust its properties to make particles fall down on the snow mesh:

{% embed url="<https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVDsGRBXgFisq0hO6tTXv%2Fuploads%2Fi3OMlxymEZ3Hu8uKA2DQ%2F1.mp4?alt=media&token=a3949de3-ea3e-4749-ae6b-7329b4b4fa46>" %}
{% endstep %}

{% step %}
Create new material with the particle shader that we have created and assign it to the particle system. Do not worry if particles will not be rendered after that. The reason is that DRM node properties are not defined in this new material and they are need to be updated using **DRM Controller**.
{% endstep %}

{% step %}
Add particle material to the **Materials** array in the **DRM Controller** script. Now adjusting DRM settings in **DRM Game Object** will affect both snow on mesh and particles:

{% embed url="<https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVDsGRBXgFisq0hO6tTXv%2Fuploads%2FXq3yXBJWr7fX2evyAzK3%2F2.mp4?alt=media&token=ad7c7ff3-d81e-44c1-a111-1e6096cabcc7>" %}
{% endstep %}
{% endstepper %}

To summarize two shaders we have created:

* First, snow shader uses DRM node for interpolating Ground and Snow textures using **Lerp**.
* Second, particle shader uses the the same DRM node for Alpha transparency.&#x20;
* As both shader use the same DRM node and their settings needs to be synchronized we have used one **DRM Controller** script for updating both materials.
