So… this is a humble progress of the project I’m implementing using BJS 5 until May 5th. For now it just shows a little section of a terrain patch, but the end result is a bit more ambitious than that…
It is not just brute force displacement, it’s actually a quadtree and there is a lot going on already. I think that next update will come next week, when things will be way closer to something usable.
Well, performance is obtained by doing all the generation inside the GPU. I generate 3D noise and then displace node vertices inside shaders. When I need to perform collision detection, I use transform feedback to get displaced vertices back to the CPU. But I only do that when very close to the ground, and only get for the closest nodes, not the entire planet.
Scale is solved in two ways: first, the use of floating-origin. Each node is handled separately. So, closer nodes have more precision, farther nodes have less precision. The second, I let it solve itself.
Think about it: when you’re very far from a planet, there is some imprecision because the quadtree nodes are huge (each one extending the diameter of the planet). But they’re very far and you don’t see that imprecision at all. When you’re very close to the ground, there is so much split already that the nodes are small enough to have close to full or even full floating-point precision.
My implementation is not able to split up to real-life ground resolution, though. I mean, at the highest split level (around 12 or 13), the resolution is more like 10 meters between triangles iirc. Ideal would be 1m or less per triangle. I would need to split to about level 20 to have full ground resolution – you know, as tesselated as normal ‘flat’ terrains – but after level 12 or so I start to see noise imprecision. I do have some ideas to solve that, but never got the time to implement them. The current resolution is sort of enough for my purposes.
I have implemented a few versions to solve the gaps. Currently I just use skirts to hide differences between nodes. Those differences almost all the time happen on distant nodes, so we don’t notice them.
Your demo really blew me away. You probably already know of this technique but if not you’ll probably love this:
The wave collapse function can definitely be used here.
Also, since you have the technical chops to do generation with the GPU (would LOVE to see more tutorials for beginners btw if you know of any good ones ) you should definitely have a look at what’s being done here: