Skip to content

SirMishMash/Unity-StylizedGrass

Repository files navigation

SMM - Stylized Grass

Author: SirMishMash
The following documentation will expand upong the SMM - Stylized Grass asset.

Required project settings

In order to successfully implement SMM - Stylized Grass asset into your project, please make sure your project works with the High Definition Render Pipline (2019.4.7+) or HDRP for short.

Step 1: Breakdown

After adding the asset to the your project, you will find a couple files and folders.

The following folders are organized in a way that will help streamline your understanding for both the asset and VFX Graph in Unity HDRP.

Section Description
Demo A folder that contains files that help set up the scene "Demo - Grass"
Prefabs A folder that contains example prefabs that you can use and experiment with
Textures A folder that contains textures that affect how the grass is rendered and moves
Grass Profile A diffusion profile used in HDRP that is used with the VFX Graphs provided to help create subsurface scattering effects

NOTE: in order to successfully implement the profile, you must include the profile inside of the "Diffusion Profile List" in your HDRP settings.

Step 2: Getting Started

Inside the Stlyized Grass folder, enter the "Demo" folder and select the "Demo - Grass" scene.

The following scene will look like the following image below: Section of the scene where grass is shown Section of the scene where soft particle grass is shown Section of scene where practical implementation is shown

By using the scene, users are given a scene where they can tinker with the asset and prefabs found with the asset package.

Looking into the prefab folder, the user will encounter a number of prefabs with a particular naming convention.

ex. nQuad-Circle

Section Description
n or s Determines what kind of particle is spawned. If normal (n), the particle will spawn in normally. If soft (s), the particle that spawns in will be a soft particle. A soft particle has an alpha blending effect towards object that clip into the asset creating.
Quad or Tri Determines if the particles are spawned as quads or triangles.
Circle or Plane Determines the shape of the particles spawning area.
Circle: the area the particles are spawn in are within a circle
Plane: the area the particles are spawn in are within a plane

Using the asset is as easy as dragging one of the SMM - Stylized Grass prefabs into a desired scene. The following .gif shows the prefab being dragged into the "Demo - Grass Scene" that comes with the asset package.

Rather than using an existing prefab, the user is able to drag a VFX Graph into the scene as well.
NOTE: Take notice of the mouse position in the example below. The asset does not appear in the scene where the mouse drags the asset. Unlike the prefab, the asset will default to the world's origin (0,0,0).

Step 3: Customization

Another great feature about this asset is the ability to customize the grass to the user's liking. Particle types, number of particles spawned, colour, are just a few of many parameters the asset will allow you to edit.

Selecting the asset or prefab after placing it into the scene, opens new options in the Inspector tab.

In the Inspector, there are checkboxes besides each of the settings that can be altered. Boxes that are not checked, means that it is currently using the default settings found within the VFX Graph it is associated with.

The moment a parameter is altered, a checkbox will appear besides the altered setting. If there is a undesired result after altering a parameter, simply clicking on the checked box will undo the changes and reset parameter back to its default settings.

Set Up

How the particles are instantiated. Settings to initialize spawning grass.

Section Description
Grass Blade Texture The texture used to render each individual grass blade
Blades of Grass The number of grass blades spawned at a time
Bounds Size Absolute area for particles to spawn and a factor that determines whether or not asset is culled if camera rotates away from asset
Grass Spawn Area Determines where the grass particles will spawn
Random Height Randomly sets the height of the grass using 2 variables.
X = Min and Y = Max
Random Width (Min and Max) Randomly sets the width of the grass using 2 variables.
X = Min and Y = Max

Grass Blade Settings

How reach blade of grass is rendered. Settings that deal with the color of the grass blades

Section Description
Grass Fade Distance Strength of alpha blending effect when particles clip into another object.
Note: Only applies if asset is a soft particle.
Grass Smoothness Determines how smooth the surface of the grass is.

Image from Unity Documentation on Smoothness
Color Random Gradient The color of each grass blade will be determined randomly from the gradient that is set.

Wind Settings

How the grass sways or moves. Settings that applies fake wind to the grass.

Section Description
Wind Noise Texture The texture that applies the wind effect onto the grass particles.
Wind Noise Tiling Determines how many times the grass texture is tiled. The higher the number, the more times the texture repeated within the X and Y axis of the texture.
Wind Scroll Speed Sets the direction and speed of the modified texture. This determines how fast the grass will sway.
Wind Push Intensity A base level modifier that changes how much the grass sways.
Wind Push Intensity Multiplier Another multiplier that changes how much the grass sways but for all axis.

I would love to see how you implement my asset into your project. Feel free to @ me on Twitter or email me personally.
Twitter: @sirmishmash
Email: sirmishmash@gmail.com

When crediting the asset, please use the follow to credit the project and I (Optional):
Jon Ben Oliver (aka SirMishMash)

Wanna Support the Project and I?

About

Create numerous stylized grass blades with this highly performant and scalable HDRP grass asset that makes use of VFX Graph.

Topics

Resources

License

MIT, Unknown licenses found

Licenses found

MIT
LICENSE
Unknown
LICENSE.meta

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published