-
Notifications
You must be signed in to change notification settings - Fork 0
How to adjust grass leaves simulation in homepage landscape
The grass.jsx
file in the components might seems like the primary location for animation adjustments. However, it’s primarily for grass distribution.
The actual animation is controlled by the compute.frag
, a shader that manages multiple elements like terrain height and wind.
In compute.frag
shader, look for the time vector, specifically on line 40.
The time vector’s current computation involves multiplying the actual time (in milliseconds) by a negative value (-0.125). This is for normalization purposes, making it easier to read and correlate with other factors.
Increase the multiplier (e.g., change -0.125 to 0.25).
Decrease the multiplier (e.g., change -0.125 to -0.025).
After modifying the value, save the file. Note that this change is not taken into account by Vite hot reloader, just refresh the page :)
The compute fragment shader is utilized for its efficiency in handling multiple computations. It calculates various elements like terrain displacement, wind variations across the screen, and fog. This approach enables sharing computations across components, such as terrain, grass, and pebbles. By adjusting the compute fragment, you effectively control the speed of the entire animation, including the wind and cloud movements that affect the grass.