Hydraulic Erosion Simulator
Note: This simulator uses Unity’s Experimental WebGPU graphics API, which is not compatible with Firefox. Use Chrome/Edge.
Note 2: If you are a laptop user or are experiencing noticeably poor performance, it's likely your browser decided to run this with your computers integrated GPU. Quick instructions to fix this can be found below.
Fixing Performance Issues:
Note: Mainly affects laptops - restart browser after changes
You may want to revert these after done with this application, otherwise web browsing will require more laptop battery
- Right-click desktop → Display settings
- Click Graphics → Browse for your browser:
- Chrome:
C:\Program Files\Google\Chrome\Application\chrome.exe
- Edge:
C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe
- Chrome:
- Set to High Performance → Save
- You may need to relaunch the browser for this to take effect
- System Settings → Battery
- Select your device on left → Disable "Automatic Graphics Switching"
- Paste into address bar → Enable these flags:
chrome://flags/#ignore-gpu-blocklist
chrome://flags/#force-high-performance-gpu
edge://flags/#ignore-gpu-blocklist
edge://flags/#force-high-performance-gpu
- Relaunch browser when prompted
- Ensure laptop is plugged in (power saving blocks dedicated GPU)
- Update graphics drivers
- Check WebGPU is enabled:
chrome://flags/#enable-webgpu
/edge://flags/#enable-webgpu
- Confirm your computer has a dedicated GPU. You may only have one:
- Open System Monitor:
- Windows: Press
Ctrl+Shift+Esc
→ "Performance" tab - Mac: Open Applications → Utilities → Activity Monitor
- Windows: Press
- Check GPU Section:
- Windows: Look at bottom-left under "GPU" - if multiple GPUs appear
- Mac: Click "Window" → "GPU History" → See if two graphs appear
- Identify GPUs:
- If you see two GPUs: Dedicated GPU present (usually labeled)
- If only one GPU: Integrated graphics only
- Dedicated GPU names: NVIDIA, RTX, GTX, AMD Radeon, RX
- Integrated names: Intel HD/UHD, Iris Xe, Apple M1/M2 Graphics
- Open System Monitor:
Resolution and the Erosion Simulation Data values will have the highest impact on performance. Extreme erosion values may break simulation, adjust to better range or increase resolution for more stability.
Over-engineered Hydraulic erosion simulation, inspired by Sebastian Lague.
Controls: Drag left and right with the mouse to turn the mesh.
Click on the drop-downs to see what each option does:
Terrain
Resolution: How many faces will be used for the mesh. Detail will increase as resolution does. Higher values may cause the program to slow down. Low values will also cause less accuracy in erosion.
Height Factor: Affects how tall the initial generated terrain will be. Due to this changing the angle of the initial generated terrain, this will also have some impact on erosion
Noise Type: Determines what noise function will be used to generate the terrain. The options are Perlin, Simplex, and Worley Noise, which each generate their own unique looking terrain.
Noise Zoom: How scaled the noise used to generate the mesh will be. Mimics zooming in on terrain. Higher noise zoom values will cause artifacts in the terrain that can be mitigated by an increase in smoothing passes. Domain warping can also help with artifacts, but to a lesser extent.
Octaves: How many layers of noise will be used to generate the mesh.
Persistence: Controls how much influence each successive octave has on terrain generation.
Lacunarity: Defines the frequency of scaling between octaves. Higher values will lead to a more chaotic mesh.
Warp Strength: Affects how much the noise pattern is displaced or deformed.
Warp Frequency: Determines the scale of warping effects. Lower values lead to smoother warps while higher values lead to more intricate ones.
Seed: Used to prevent randomness. Using the same seed will lead to similar results. For the purposes of this simulation, terrain generation is deterministic, while erosion is random but still constrained by the seed.
Offset: Scrolls across the noise function.
Smoothing Passes: How may times the mesh will be smoothed slightly. This is done to prevent noticeable artifacts, which naturally come from noise functions.
Erosion
Enable Erosion: Lets the user toggle erosion on and off. Turning erosion off can help to view what the initial terrain looks like before erosion is applied, making it helpful for tuning terrain parameters.
Number of Raindrops: The number of raindrops that will be used to simulate hydraulic erosion. Starting positions of each drop are deterministic based on the seed, however their movement will be random due to the simulation taking place on the gpu. Higher values may impact performance.
Travel Time: The maximum number of steps a raindrop will take before terminating. Higher values will cause longer and deeper erosion trails on the terrain. Higher values may impact performance.
Drop Radius: The area of influence each raindrop will have. Higher values may impact performance.
Inertia: How much a raindrop ignores the direction of the terrain. Values near 0 mean raindrops mostly follow the terrain, while values near 1 mean they mostly ignore the direction of the terrain, which may result in straighter erosion lines.
Carry Capacity: Maximum sediment a drop can hold. Higher values allow more erosion before depositing, and ultimately leads to more sediment being placed at lower elevations, which flattens it a bit.
Deposit Speed: How quickly excess sediment is dropped when capacity is exceeded. High values lead to a lot of sediment being dropped, elevating the terrain marginally, while a low deposit speed can lead to sediment rarely being dropped, leading to very little change in the terrain.
Evaporation Speed: Rate at which water volume decreases over time. lower values mean droplets have more weight at the start of their path while higher evaporation speeds mean droplets have more higher weight later into their lifetimes.
Terrain Hardness: How difficult it is to erode terrain. Higher values will see less impact from erosion.
Gravity: Amplifies velocity changes from elevation differences. Higher values make drops accelerate faster downhill. Generally, this causes mountains to be a bit wider at high gravity than low gravity.
Flow Threshold: Minimum slope angle required for meaningful sediment transport. Prevents drops from getting stuck on flat terrain by ensuring minimal erosion capacity. This is a more experimental parameter, I recommend keeping it's value low.
Visuals
Noise Map Mode: When enabled, shows what the noise map looks like currently rather than the terrain.
Height Curve: A few preset options that control the weighting of the height map. Leads to a bit more visually interesting terrain.
Grass Height: How high up the mesh grass can appear. 0 is means no grass, and is based on the water level rather than the bottom of the mesh.
Grass Threshold: The maximum slope that grass can appear on. Lower thresholds mean that grass can only appear on flatter terrain.
Grass Blend Factor: How long it takes rock to blend to grass once the threshold is passed.
Enable Water: Toggles water on and off.
Water Height: Affects how high up the mesh water will appear.
Water Depth: Determines the cutoff point for where the transition between shallow and deep water is. 1 means at the water level (Almost all deep water), 0 means at the bottom of the mesh (Almost all shallow water).
Sun Height: Affects the vertical angle that sunlight comes from. 0 Would mean the sun is on the horizon while 90 would make it directly overhead.
Sun Angle: Affects the circular angle the sun would be projected from. Determines whether it is directed towards or away from the camera.
Updated | 1 day ago |
Status | In development |
Platforms | HTML5 |
Author | Elumenix |
Genre | Simulation |
Made with | Unity |
Leave a comment
Log in with itch.io to leave a comment.