4 ms·
Yep, I've read that paper. What I did was actually simpler than any paper I've seen, so I will just describe it here. The basic data structure is taken from RO
by cousin_it 16y ago
Yep, I've read that paper. What I did was actually simpler than any paper I've seen, so I will just describe it here.
The basic data structure is taken from ROAM: a bintree of right triangles. It is regenenerated from scratch on every frame, recursively, starting from several top-level triangles. (So it's technically a multi-tree, I guess.) A triangle is split if the midpoint of the hypotenuse has a screen-space error of more than 10 pixels. Each triangle knows its children and neighbors, so each split can cause neighboring triangles to split to avoid T-junctions. (This was by far the trickiest part of the code, similar in difficulty to balancing a red-black tree.) I also take many not-quite-correct shortcuts, like stopping the splitting process if the triangle lies completely behind the camera or outside the screen bounds.
I believe the main reason my engine looks so good is because it uses satellite photos for textures - they hint at a lot of 3D detail that isn't expressed by the triangles. I render only 1 or 2 thousand triangles per frame, but they pretend to be a lot more, if you don't look at the ridges too closely. Try the m and i keys to look under the hood.
- JoelPM 16y agoThanks for the explanation - very cool!