vengi-voxel / vengi

free and open source voxel art tools - editor, thumbnailer and format converter
http://vengi-voxel.github.io/vengi/
Other
1.05k stars 87 forks source link

VOXEL: MeshState at mesh_size boundaries duplicates vertices #445

Closed mgerhardy closed 2 months ago

mgerhardy commented 2 months ago

Bildschirmfoto vom 2024-04-06 11-22-19

Notes

voxel_meshsize is 64 MeshState::extractRegion()

mgerhardy commented 2 months ago

might be related to #389

looks like it is related to the mesh extraction region in the MeshState - and it's best visible when using alpha values < 1

these are the regions that are extracted

extract region: region[mins(ivec3(-64, 0, -64)), maxs(ivec3(-1, 63, -1))]
extract region: region[mins(ivec3(-64, 0, 0)), maxs(ivec3(-1, 63, 63))]
extract region: region[mins(ivec3(0, 0, -64)), maxs(ivec3(63, 63, -1))]
extract region: region[mins(ivec3(0, 0, 0)), maxs(ivec3(63, 63, 63))]

this is the result of vertices for this case

1 => Vertex(0): 0.000000:0.000000:-1.000000
1 => Vertex(1): 0.000000:1.000000:-1.000000
1 => Vertex(2): 2.000000:0.000000:-1.000000
1 => Vertex(3): 2.000000:1.000000:-1.000000
1 => Vertex(4): 0.000000:0.000000:1.000000
1 => Vertex(5): 0.000000:1.000000:1.000000
1 => Vertex(6): 2.000000:0.000000:1.000000
1 => Vertex(7): 2.000000:1.000000:1.000000

1 => Vertex(0): -1.000000:0.000000:-1.000000
1 => Vertex(1): -1.000000:1.000000:-1.000000
1 => Vertex(2): 1.000000:0.000000:-1.000000
1 => Vertex(3): 1.000000:1.000000:-1.000000
1 => Vertex(4): -1.000000:0.000000:1.000000
1 => Vertex(5): -1.000000:1.000000:1.000000
1 => Vertex(6): 1.000000:0.000000:1.000000
1 => Vertex(7): 1.000000:1.000000:1.000000

1 => Vertex(0): -1.000000:0.000000:0.000000
1 => Vertex(1): -1.000000:1.000000:0.000000
1 => Vertex(2): 1.000000:0.000000:0.000000
1 => Vertex(3): 1.000000:1.000000:0.000000
1 => Vertex(4): -1.000000:0.000000:2.000000
1 => Vertex(5): -1.000000:1.000000:2.000000
1 => Vertex(6): 1.000000:0.000000:2.000000
1 => Vertex(7): 1.000000:1.000000:2.000000

1 => Vertex(0): 0.000000:0.000000:0.000000
1 => Vertex(1): 0.000000:1.000000:0.000000
1 => Vertex(2): 2.000000:0.000000:0.000000
1 => Vertex(3): 2.000000:1.000000:0.000000
1 => Vertex(4): 0.000000:0.000000:2.000000
1 => Vertex(5): 0.000000:1.000000:2.000000
1 => Vertex(6): 2.000000:0.000000:2.000000
1 => Vertex(7): 2.000000:1.000000:2.000000
mgerhardy commented 2 months ago

Bildschirmfoto vom 2024-04-06 14-00-24

does not only happen at 0, but on every chunk border

mgerhardy commented 2 months ago

The fix breaks extracting full vertices

extractor1 extractor1 extractor1