Fast and Gorgeous Erosion Filter: A New Approach to Virtual Terrain Generation

AI Summary
Over the past eight months, I've developed an innovative erosion technique that simulates the natural process of erosion in virtual landscapes without the computational burden of simulating countless water drops. This method, which I call the Advanced Terrain Erosion Filter, uses a special kind of noise to create stunning branching gullies and ridges. It's fast, GPU-friendly, and can be applied as a filter on top of any height function, allowing for chunk-based generation.
## Background
The inspiration for this technique came from Shadertoy, a platform where users share shaders—programs that run on the GPU to create visual effects. In 2018, Clay John introduced the Eroded Terrain Noise shader, which inspired me to build on his work. By 2023, Felix Westin (Fewes) had refined this technique further. I began developing my own versions in 2025, addressing some limitations and introducing more intuitive parameters.
## The Basic Idea
The technique starts with a height function that includes the gradient, indicating the steepest ascent. Water flows opposite to this gradient, forming gullies and ridges. By adding stripes along the gradient, we simulate the erosion effect. These stripes are repeated at smaller scales, called octaves, to create a complex pattern of gullies and ridges.
## Generating Stripes
To avoid chaotic patterns, the stripe pattern is divided into cells, each with its own pivot point for rotation. This minimizes distortion and ensures smooth transitions between cells. The stripes are blended using sine and cosine waves, resulting in a continuous pattern.
## Preserving Peaks
To maintain the integrity of mountain peaks and valleys, I explored two approaches: the frequency approach and the fade approach. The frequency approach adjusts stripe frequency based on slope, while the fade approach adjusts the stripe's intensity. Both methods have their pros and cons, but the fade approach offers more control over the appearance of peaks and valleys.
## Enhancing Crispness
To achieve crisper gullies, I developed techniques like stacked fading, normalized gullies, and straight gullies. Stacked fading updates the mask and fade target for each octave, ensuring that smaller gullies do not disrupt larger ones. Normalized gullies ensure consistent magnitude, while straight gullies prevent smaller gullies from running parallel to larger ones.
## Additional Features
The technique also allows for the creation of water drainage patterns, mimicking natural dendritic drainage systems. By maintaining two versions of the fade target and mask, one can create a ridge map that highlights these features.
## Future Work
While I don't plan to further develop this technique, I hope others will explore its potential. The code is open-source under the Mozilla Public License v2, inviting collaboration and innovation. Future work could focus on emulating specific terrain types or improving the technique's robustness.
## Conclusion
This erosion filter technique represents a significant advancement in virtual terrain generation, offering a fast and visually appealing alternative to traditional methods. With its open-ended nature, it holds great promise for future developments in the field.
Key Concepts
Erosion simulation in virtual landscapes involves replicating the natural process of erosion, where water shapes terrain by carving gullies and ridges. This is typically computationally intensive due to the need to simulate numerous water drops.
A noise function is a mathematical function used to generate random or pseudo-random values. In graphics, it is often used to create textures or simulate natural phenomena like clouds, terrain, or water.
Category
TechnologyMore on Discover
Summarized by Mente
Save any article, video, or tweet. AI summarizes it, finds connections, and creates your to-do list.
Start free, no credit card