Mapgen4 river shader

 from Red Blob Games’s Blog
DRAFT
Blog post: 30 Sep 2025

STILL WORKING ON THIS - ETA Oct 2

{ diagram of rivers }

The original plan was to have two dimensions because of river confluences. But I ended up drawing two separate curves, so I only needed one dimension. And that curve is easily expressed in a shader, so I didn’t need the texture at all.

https://www.redblobgames.com/x/1730-terrain-shader-experiments/#curved-paths[1]

Old rivers
New rivers
Old rivers
New rivers

LLM story - interactive explorable tool for building intuition, again not using the code, but using it as a stepping stone

https://www.redblobgames.com/x/2531-barycentric-bezier/[2]

This made me see that there is a way to do what I want, and it’s not from bezier curves like I originally thought. The LLM produced code helped me figure it out, but sadly, it wasn’t able to directly give me a solution.

I still need to figure out the math, and if I can figure out how to prompt the LLM properly, I might be able to get it to give me the answer. Otherwise I’ll work it out on paper.

I am hoping this gives me better rivers but I won’t know until I try.

text

link to project