Simple Shaders
For simple shaders, we can grab Zephyr's value directly and use it to add wind offset. While the behavior is not as realistic as it could be, it can provide a good head start when creating your own wind interactions. For more detailed physics out of the box, try using one of the pre-built mediums!
Shader Graph
Use the Function Outputs to Simulate Wind
Each of the outputs of the Zephyr node give you access to a unique component of the combined wind. The Wind output gives you the combined wind. This only gives the offset so it must be added back to the local vertex position before being passed into the vertex offset in Shader Graph.

Learn more about vertex displacement in Shader Graph here:
Amplify Shader Editor
Use the Function Outputs to Simulate Wind
Each of the outputs of the Zephyr node give you access to a unique component of the combined wind. The Wind output gives you the combined wind. This only gives the offset so it must be added back to the local vertex position before being passed into the vertex offset in Amplify unless your vertex offset is set to relative.
HLSL
Find the “Vertex” Section
Search (Ctrl+F) for one of these words inside the shader file:
vert
vertex
appdata
v.vertexYou’re looking for a function that looks something like this:
void vert(inout appdata_full v)
{
// This is where the vertex is modified
}or maybe this:
v.vertex.xyz += someMathHere;That’s the part that moves the mesh’s vertices. We’ll inject Zephyr’s wind into that section.
Include Zephyr’s Wind Code
Right above your vertex function (or near the other includes), paste this line:
#include "Packages/com.distantlands.zephyr/Runtime/Shaders/HLSL/ZephyrWind.hlsl"This line brings in all the Zephyr wind functions and settings — you don’t need to define them yourself.
💡 If your shader doesn’t compile after adding this, check for typos or missing quotes. The path must be exact.
Get the Vertex’s World Position
Inside the vertex function, find where the shader gets each vertex’s position.
Usually, it’s something like v.vertex or input.position.
Add this line below it:
float3 worldPos = mul(unity_ObjectToWorld, v.vertex).xyz;That line converts the vertex position from object space (relative to the mesh) into world space (relative to the scene). Zephyr’s wind works in world space, so this step is essential.
Ask Zephyr for Wind at That Position
Now add this line underneath:
float3 wind = GetWindAtPoint(worldPos);This tells Zephyr to return a 3D wind vector based on where that vertex is located in the scene.
That wind includes:
Base wind (the constant breeze),
Gusts (large shifting waves of wind),
Flutter (small, fast vibration),
Any local Wind Zones nearby.
Apply the Wind to the Vertex
Now make the vertex move according to the wind:
v.vertex.xyz += TransformWorldToObjectDir(wind) * _WindStrength;That line:
Converts the world-space wind back into object space (so your mesh doesn’t deform oddly),
Scales the strength of the effect with
_WindStrength(you can add this property to your shader or hardcode a small number like0.2).
So the full section now looks like this:
#include "Packages/com.distantlands.zephyr/Runtime/Shaders/HLSL/ZephyrWind.hlsl"
void vert(inout appdata_full v)
{
float3 worldPos = mul(unity_ObjectToWorld, v.vertex).xyz;
float3 wind = GetWindAtPoint(worldPos);
v.vertex.xyz += TransformWorldToObjectDir(wind) * 0.2;
}And that’s enough to get working wind movement. Feel free to manipulate the wind output at this stage to better fit your material's needs!
Last updated




