New: Nature Shaders

Interaction, Wind, Dynamic Masking, and Better Shading for your vegetation.

Learn more
This page may not work correctly inside the Unity editor. Open in browser

Quickstart

Nature Shaders is a collection of shaders intended for vegetation in Unity. You can use Nature Shaders to improve the quality of your vegetation rendering, and to enable effects such as interaction or wind simulations.

  1. Import Nature Shaders
  2. Create a Nature Asset
  3. Enable Wind
  4. Enable Interaction and Overlays

Step 1: Import Nature Shaders

Importing Nature Shaders is very straightforward: just import the Unity Package that you downloaded from the official website, or import Nature Shaders from Unity's package manager.

There is no need to worry about the render pipeline that you are using, Nature Shaders automatically imports the correct assets.

After importing Nature Shaders for the first time the demo scene will automatically open. Select any of the "Move Me" objects in the scene and move them around to see the interaction and overlays in action.

nature-shaders-demo-interaction-550.gif

Step 2: Create a Nature Asset

Now that you have Nature Shaders in your project you probably want to use it for some of your own models. Nature Assets are used to easily set up or convert models and prefabs for use with Nature Shaders.

  1. Right-click on a model or prefab and select Create > Nature Asset.

    nature-shaders-create-nature-asset-for-prefab.jpg

  2. Select the new Nature Asset to show the import settings in the inspector.
    nature-shaders-nature-asset-inspector.jpg
  3. Find the Material Conversion section in the import settings and assign the material types for each material. The material type determines what shader is used for the material, and also determines how the mesh is analyzed. More details can be found in the Nature Assets article.
  4. Click "Apply" at the bottom of the inspector to apply the settings, and then drag the Nature Asset into the scene to use it.
  5. Adjust additional settings to tweak the model. See the Nature Assets article for all the settings that can be edited.

Do not delete the original assets after creating a Nature Asset. The Nature Asset is linked to the original assets and is updated when you modify the original assets.

Alternatively, you can manually set up a new material.

Step 3: Enable wind in your scene

Wind is enabled by default for new materials, but still needs to be set up in the scene.

Create a new game object in the scene and add a "Global Wind" component. The Global Wind component controls the wind settings for the scene. In the component you can adjust the wind strength, direction, and more.

For a quick and easy setup you can select a preset from the Load Preset dropdown.

See the Wind article for a full description of each setting.

nature-renderer-quickstart-load-wind-preset.jpg

 

Step 4: Enable interaction and overlays

The materials are automatically set up for interaction and all other features but you still need to set up the objects in your scene.

Interaction

  1. Select the game object in the scene that you want the vegetation to interact with.
  2. Add a collider to the game object if it does not have any colliders. The colliders are used for interaction.
    Tip: Set up a Collision Layer if you want the collider to only interact with vegetation and not with other objects.
  3. Add a Nature Collider component. This component will register the colliders on the object as colliders that should interact with vegetation.
  4. That's it, the vegetation should now interact with the object and sway when the object moves around. Both in edit-mode and at runtime.

Read more in the article about Object Interaction.

Overlay

  1. Select a game object in the scene that you want to use as overlay, or create a new game object.
  2. Add a collider to the game object. Vegetation within this collider will be affected by the overlay.
    Tip: Set up a new collision layer for overlay objects, so that the overlay colliders don't interact with other objects in the scene.
  3. Add a "Nature Overlay" component to the game object. This will register the collider as being an overlay, and is used to adjust the overlay settings.

Read more in the Overlay article. 

 

Was this article helpful?
6 out of 8 found this helpful