Adding cubic bezier for smoother triangles... or not
It’s become quite obvious that flat triangles are not going to cut it at the resolution that the erosion simulation will run at, see the flat-shaded image below:
(Blue is ocean water, teal is lake water, the splotchy texture is showing Voronoi diagram cells around each vertex)
Linear interpolation, AKA flat triangles. Click to enlarge
I imagined that this could be solved if I could implement cubic bezier triangles instead, I’d not implemented beziers before, let alone 3D, but it was going to be worth it. Here it is:
‘Smoothing’ the triangles with cubic bezier. wtf? Click to enlarge
WTF??
So many different bugs, weird bugs, where to even start…
At least that ridge on the right peak has turned into a nice curve, if a little crinkly.
The pictured implementation subdivides each triangle many times into lots of smaller triangles, and gets the vertex positions of the little triangles from the cubic bezier surface. This is why you can make out small triangles in the places where it’s wrinkled.
[This is a backfilled entry, because I spent so much f’ing time sorting out these bugs, only to decide cubic bezier wasn’t good enough and not use it for landscape interpolation any more]