1
General Discussion / Smooth Meshing (I know; something noone's asking for :) )
« on: April 02, 2020, 12:45:48 pm »
I've been toying with smooth meshing for a while, determined to not have to use 'marching cubes'; that surly there's a simpler way. It's maybe not a 'better' way in all aspects...
https://gist.github.com/d3x0r/5633f0548f4d7b283f8bab19e022acad (pretty pictures included)
(How much TL;DR to include...)
tetrahedra only have 2 mesh modes - 1 point in/out and an edge out which generates a quad that's not constrained flat.
The example code is JS; and it looks like a lot; the plane mesher (that calculates each shared point only once) is actually simple (perhaps it's because I've been staring at it for dayz). That is, the first version was long-form expanded with if's; and series of statements; I consolidated those into lookup tables, and 'simplified' the overall required code, at the cost of legibility perhaps? (Like I never really did understand your face mating tables )
This forms a mesh around the points as a center (instead of sort of in-a corner of the cube), which offsets it by (0.5,0.5,0.5); but for things like trees, and other geography would think smoothing would work well, using world-space coodrinates for texture uv-coordinates; was also playing with the ability to 'inflate/deflate' the mesh and realized that meshing water deflated and land inflated would give a very nice transition.
Still requires a pass to stitch sectors together; otherwise data has to be duplicated; can easily do default 'outside' 'inside' by faking 1 render point outside... hmm actually that's just on the stitch line; I should add the stitch pass as another option...
There is certainly a lot of space for square meshes!
Peace and good health to you!
https://gist.github.com/d3x0r/5633f0548f4d7b283f8bab19e022acad (pretty pictures included)
(How much TL;DR to include...)
tetrahedra only have 2 mesh modes - 1 point in/out and an edge out which generates a quad that's not constrained flat.
The example code is JS; and it looks like a lot; the plane mesher (that calculates each shared point only once) is actually simple (perhaps it's because I've been staring at it for dayz). That is, the first version was long-form expanded with if's; and series of statements; I consolidated those into lookup tables, and 'simplified' the overall required code, at the cost of legibility perhaps? (Like I never really did understand your face mating tables )
This forms a mesh around the points as a center (instead of sort of in-a corner of the cube), which offsets it by (0.5,0.5,0.5); but for things like trees, and other geography would think smoothing would work well, using world-space coodrinates for texture uv-coordinates; was also playing with the ability to 'inflate/deflate' the mesh and realized that meshing water deflated and land inflated would give a very nice transition.
Still requires a pass to stitch sectors together; otherwise data has to be duplicated; can easily do default 'outside' 'inside' by faking 1 render point outside... hmm actually that's just on the stitch line; I should add the stitch pass as another option...
There is certainly a lot of space for square meshes!
Peace and good health to you!