Marching Cubes, Triplanar Mapping, Multires Textures, and Lemur

@reveance said: Looks awesome! I was investigating this topic for a little bit a few days ago but this certainly gives me motivation to push myself to go do something :p

I was wondering though, what is the performance like and if its good, are there any real drawbacks of this, because it seems like it would be awesome for just about anything :p?

Which performance? Generating or rendering?

Rendering is not that much worse than anything else. There is some percentage of overly small triangles due to the way the algorithm works but raw performance so far seems no worse than any other type of terrain. The places you can optimize are less flexible. There are easily a dozen ways to optimize heightmaps that are completely unavailable to something like this.

The fragment shader is a little heavy. It takes lots of texture samples. The side benefit is that it only takes one shader and I don’t have to have texture coordinates or tangent buffers or anything. Just position, normal, and index.

Generation speed is ok, too. The fractal that generates the density field takes the longest. Presumably for some applications that could be done ahead of time. For this fractal on my system, a 64x128x64 chunk takes about 0.6 seconds to generate the density field and about 60 ms or so to generate the mesh. This could be sped up significantly by any density field storage model that could easily mark empty chunks. In fact, in the final version of this test app I will chunk vertically as well since often there is a very limited vertical span where geometry gets generated… similar to a height map.

2 Likes