339 points · by mourner · 7y ago · 65 comments
But baking irregular meshes into a tree-structure could be powerful too I suppose, I'm not that familiar with algorithms involving them. All of this is highly dependant on actual size of terrain and LOD requirements, terrain rendering is a deep rabbit hole.
If you can precompute various LOD chunks for each tile and cache them, under some circumstances that's optimal, but I don't think any of them are webgl. A typical heightmap based terrain renderer today will consist of several (3-5) prefab LOD meshes deformed by height map textures in shader, like[1]. Swapping a textures in and out of vram is cheaper than swapping geometries, even if those geometries are of lower resolution.
Modern GPUs are almost never bound by the number of triangles on screen. The bottleneck will be the fillrate and bandwidth and pipeline stalls, especially in webgl. If you can throw down more triangles to do less of the other things, it's almost always worth it.
I have a toy mapbox tile renderer based on this approach. I'd love to know if you guys have plans to implement full 3d like google maps any time soon.
I'm thinking of tracing for foot placement in conjunction with inverse kinematics for walking characters, or vehicle wheels traversing the terrain. I've run into this problem with UE4.
[0]: http://www.iquilezles.org/www/articles/terrainmarching/terra...
Similar to the Middle earth style map, but for the web: https://adventuresinmapping.com/2018/09/10/middle-earth-map-...
Vs. Chrome: https://i.imgur.com/Go0mt1K.png
RuntimeError: renderer could not be resolved
Browser: Mozilla/5.0 (Linux; Android 9; Nokia 7.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.143 Mobile Safari/537.36
Content Security Policy: Couldn’t process unknown directive ‘prefetch-src’
THREE.WebGLRenderer 107 three.min.js:187:462
Error: WebGL warning: <SetDimensions>: Failed to create
WebGL context: WebGL creation failed:
* tryNativeGL
* Exhausted GL driver options. three.min.js:190:415
Error: WebGL warning: <SetDimensions>: Failed to create
WebGL context: WebGL creation failed:
* tryNativeGL
* Exhausted GL driver options. three.min.js:190:440Edit: I think the Google terrain skirts were slanted, rather than falling straight down, so two neighbouring skirts intersect in a V.
[0] https://www.researchgate.net/figure/A-terrain-chunk-a-withou...
Anybody know about best/easy/fast/interesting algorithms for doing the opposite of the post and "compressing" the data eliminating triangles for a prescribed error or some other metric?
The non-textured demo actually looks better. Nothing that can't be fixed by stitching higher resolution sat imagery though!
https://blog.mapbox.com/bringing-3d-terrain-to-the-browser-w...
Is it just faster? Also, is Peter's work FOSS?