Closed tostc closed 7 months ago
The new mesher is finished.
The new greedy mesher definitely reduces vertex count more than the "chunky greedy" setting, however it is still not perfect. Here are the comparisons between the ones VOptimizer uses:
Original coloured:
Greedy:
Chunked Greedy:
And this is how it would look when using the correct algorithm: (got this one using this Blender addon: https://github.com/AstrorEnales/blender_magicavoxel)
I notice an issue in my implementation yesterday, maybe this would result in a better result. At the moment I'm adding the option to the new greedy algorithm to generate a texture instead of just a colorpalette. This would result in less vertices and faces, but a bigger texture. Similar to your blender addon.
I've didn't look at the source of the addon, only at the readme but this addon and my library using the same source for the greedy algorithm. But maybe not the same implementation. I make use of multithreading, which generates this chunk like pattern of 16x16x16 cubes as seen in the greedy chunk algorithm.
I believe the addon does have a texture option, but I don't use it, I actually prefer your solution to simply use the default diffuse colours on parts that don't have materials, as it's cheaper to render but looks the exact same.
I've released a new version, where I fixed the bug I mentioned. Maybe the result is now better for your mesh.
At the moment, the greedy mesher only meshes its current chunk, which is assigned to the thread. This behaviour can be observed here. To fix this problem, the output of the threads should be combined in an extra stage and then the mesh should be generated.