Simple wind simulation and velocity reaction.
Sways in any direction.
Best for bushes/trees and other foliage suspended in the air.
Simple wind simulation and velocity reaction.
Sways back and forth along its right axis.
Best for grass/flowers and other small foliage that grows out of the ground.
Each shader is available in two variants - normal and pixelart.
Default sprite | grass_shader | grass_pixelart_shader |
---|---|---|
![]() |
![]() |
![]() |
Pros:
- Pixel-perfect distortion at higher resolutions
Cons:
- Computationally heavy
- Can be used only with normal sprite renderers.
Pros:
- Lightweight
- Can be used with any renderer
- Can be used for non pixel art assets
Cons:
- Pixel-perfect effect requires upscaling
Depending on what shader variant you are using, you will need to prepare your sprites differently.
Normal shaders displace the vertices of a mesh. To improve the effect, a mesh needs to be additionally subdivided. This can be done using the Custom Outline mode of the Sprite Editor (see the table below).
Pixelart shaders displace only the uv coordinates, the mesh itself stays the same. To make it work, the mesh needs to be bigger than the actual sprite to account for any possible displacement. This can be done using the Sprite Editor (see the table below) or the import settings.
Normal shader | Pixelart shader | |
---|---|---|
Outline | ![]() |
![]() |
Mesh | ![]() |
![]() |
How much the material is distorted by the velocity texture.
2D Vector defining direction and speed of the wind.
How much the material is distorted by the wind.
Scale of the noise used to generate the wind.
The distortion can be further controlled by using a secondary texture called _DisplacementMask
Channel | Function |
---|---|
R | Controls how much a given fragment/vertex get displaced by the velocity texture |
G | Controls how much a given fragment/vertex get displaced by the wind |
Secondary textures are assigned from within the sprite editor:
You can use a displacement mask to, for example, keep the branches of a bush in place:
Texture | Displacement mask |
---|---|
![]() |
![]() |
These shaders are just an example of what is possible. You can use the exposed properties to create your own interactive shaders.