4 ms·
Wow, Martini looks really interesting! I did some research about mesh simplification and had some success using https://github.com/zeux/meshoptimizer https://gi
by blaze33 6y ago
Wow, Martini looks really interesting! I did some research about mesh simplification and had some success using https://github.com/zeux/meshoptimizer https://github.com/zeux/meshoptimizer. Meshoptimizer is in c++ so I had to use the Rust wrapper https://github.com/gwihlidal/meshopt-rs https://github.com/gwihlidal/meshopt-rs and compile it to wasm.
I actually opensourced this code at https://github.com/blaze33/dem2mesh https://github.com/blaze33/dem2mesh, just have to use dem2mesh.png2mesh which given a png data, computes the heightmap, builds a mesh, simplifies it and return the data to javascript. (can be tricky though to deal with wasm)
- kylebarron 6y agoI'd be really interested in seeing performance comparisons with Martini!
- somishere 6y agoDitto :)
- somishere 6y agoYeah, Martini seems promising. Yet to implement at map scale which is why I was interested if you'd tried already! The RTIN processing itself is very straightforward / lo-rent ... that said, if you were optimising the DEM tiles on the fly you'd probably refactor / integrate the two processes to save some loops. Dropped into a service worker (or WASM) I'm guessing it would be reasonably performant. Though perhaps meshoptimizer is more flexible with mesh dimensions?? (rtin is limited to a 2^nish grid) With that in mind had you considered zooming out for your dem only, so as to lower the heightmap resolution (but leave the env map as is)? Maybe you're already doing that?
- somishere 6y agoActually here's a similar demo I put together in 2017 using heightmap only .. it's low-res, stitching together higher-altitude DEMs, but actually fairly performant without any trickery. You can zoom in on a section by drawing on the rendered tile on the left. https://codepen.io/theprojectsomething/details/rmmePG https://codepen.io/theprojectsomething/details/rmmePG