The 64th Gamer

:exclamation_exclamation: Pneumagination Milestone!!


Pneumagination now supports infinite chunk generation, walking around, and breaking Brushes! Its very nice to get everything this far without too much hassle. A critical thing however is that breaking blocks can take up to half a second to perform. This is due to the mesh generator having to split and recombine all vertices- recalculate all normals, ect. I’m gonna be working to optimize it as best I can- alongside probably splitting some parts into multiple threads, but if this still becomes a critical bottleneck I will probably have to create a setting for “flat shading” where it skips the normals recombining.

Another thing that could work is reusing data from the previously generated chunk and doing some async tasks. For example maybe the mesh is generated, a quick lookup is done for all previous normals used- leaving 99% of brushes looking the same, and then the recalculation is done asynchronously and applied later. This would mean for a short time new blocks (or now non-hidden ones) would have flat shading- and adjacent blocks to ones broken would retain their shared normal.

That would depend though on if the normals being recalculated was any signifigant portion of the render step. I think the most important part is optimizing the mesh merging part wherever I can. If I have to I may have to reduce the size of chunks to be much smaller to ensure the generation happens fast enough.

Update: Alright yeah I reduced chunk size from around 256 units to 84 units. This made chunks update near instant. There’s still a 1-3 frame stutter but if this can be done asynchronously it’ll be unnoticable. I attempted to start getting it being async but there’s lots and lots I need to untangle to keep it thread safe. The 84 unit size allows me to save each vertex position all in one byte which is great. This is gonna fall apart later though when I deal with brushes that cross multiple chunks.

Current downside is this reduces the chunk height drastically since it’s a cubed size. I guess this means I need to start working on cubic chunking soon.