Set out to make a little "open-world "game. Spent about 20 kb making this abomination:
Basically, instead of using a heightmap like any reasonable person, every terrain feature is a height function, and the terrain chunks combine all the height functions for every point. Rather than moving around the terrain, the terrain updates with an offset so it appears it moves around you. Currently I don't have any movement restrictions or physics - it's just panning the world around.
Problem is, calculating all of the heights and normals gets sort of slow. I tried splitting it into chunks instead, which helped a little, but the seams are pretty obvious since I fudged the edges so I wouldn't have to calculate heights outside of the chunk. Probably would've been more reasonable to just calculate the extra rows - I'll have to try that later.
I'll have to see if I can multithread any of this, too. Any suggestions for performance improvements would be great - right now, it's able to run at a decent frame rate, but more terrain features are going to increase the overhead. It exits most of the calculations for points out of range of terrain features, but I'll probably have to find a way to stop those from being loaded in the first place.
Definitely going to change the material so it actually looks like terrain.