A Hacker News thread lit up over “Fast and Gorgeous Erosion Filter,” a technique for simulating realistic erosion on terrains and textures in real-time graphics. Developers shared the post by Huw Bowles, who dropped a GLSL shader implementing hydraulic erosion on the GPU. It runs at 60 FPS on modern hardware for 1024×1024 heightmaps, turning flat noise into rugged mountains and valleys that look hand-sculpted.
Erosion filters mimic nature’s wear: water flows downhill, carving channels and smoothing peaks. Traditional CPU-based sims, like those in World Machine or Houdini, take minutes per iteration on large maps. Bowles’ version flips this to GPU compute shaders, processing thousands of droplets per frame. You start with a heightmap from Perlin noise, add a water simulation layer, and iterate: droplets pick up sediment based on slope and velocity, deposit it elsewhere. After 100-500 iterations, you get geological realism without artist hours.
Under the Hood: Simple Math, Massive Speedup
The core loop is elegant. Each droplet has position, velocity, direction, and sediment load. Gravity pulls it down; inertia carries it. Key equations:
// Simplified droplet update
vec2 dir = normalize(gradient(heightmap, pos));
velocity += gravity * dir * dt;
pos += velocity * dt;
// Erode: capacity based on speed and slope
float capacity = speed * speed * slope * erosion_strength;
sediment = min(sediment + capacity * (1 - water/height), capacity);
heightmap[pos] -= sediment * dt;
Bowles vectorizes this across thousands of droplets per threadgroup in WebGL or Vulkan compute. No raymarching bloat—just finite differences for gradients. On an RTX 3060, it chews 2048×2048 maps in under 10ms per pass. Compare to Jerker Widen’s 2018 CPU version: seconds per iteration on the same size.
Skeptical check: It’s gorgeous for previews, but scale matters. Artifacts appear on massive worlds—droplets don’t interact globally like real hydrology. No thermal erosion or vegetation yet. Still, for indie games or Unity prototypes, it beats $5k terrain tools.
Why Devs Care: Procedural Worlds Without the Wait
Games like Minecraft and No Man’s Sky thrive on procedural terrain, but erosion elevates it from blocky to believable. This filter slots into Godot, Unreal, or even browsers via WebGPU. Implications hit indies hardest: generate biomes on-the-fly, LOD seamlessly, no 100GB asset packs.
Numbers: Unity’s built-in erosion takes 2-5x longer per map. Bowles’ hits 1000 iterations in 5 seconds vs. 30+. For VRAM budgets, it’s lean—single float texture per map. Security angle? Procedural gen reduces piracy surface; no unique assets to steal.
Finance tie-in: Tools like this democratize AAA visuals. Studios save on sculptors ($80k/year salary); indies ship faster, hit Steam top 100. HN comments flag forks already: one adds rivers, another Vulkan port. Expect it in itch.io demos by next month.
Bottom line: Not revolutionary physics, but practical engineering. If you’re building open worlds, fork it now. Test on your hardware—overhype dies fast if it chokes on GTX 1060. Why it matters: Real-time geology unlocks next-gen exploration without next-gen budgets.







