fenomas / noa

Experimental voxel game engine.
MIT License
608 stars 86 forks source link

Custom voxel occasionally leaves one side after removal. #181

Closed minec2019 closed 2 years ago

minec2019 commented 2 years ago

Capture

Thanks for the great work @fenomas !

We have used some custom texture as the voxel material, as in the screenshot, after removing some voxels in the game world, occasionally, it left one side of of the voxel as still rendered somehow. In this case, it should not be visible. If you place any voxel in front of it, it will disappear. (Interesting enough, if you place a voxel behind it, it then disappear.)

Can you or someone shed some light in terms where we should look into to fix this issue? Thanks in advance.

minec2019 commented 2 years ago

Looks like, there is a similar issue using the example, please see the screenshot. Capture

minec2019 commented 2 years ago

My investigation so far, it happens at the boundary of the chunks.

fenomas commented 2 years ago

Hi, I actually just noticed this yesterday and am working on it. For me it only reproduces in the case where the chunk border is on the edge of the "world" - i.e. the next chunk in that direction isn't in memory. But it shouldn't be happening even in that case, so I'm trying to find the issue.

fenomas commented 2 years ago

Found it - basically it was sometimes breaking out of the loop to check whether to remesh neighboring chunks. But the nature of the bug meant that the error usually didn't occur, which is why it only reproduced in certain locations close to unloaded chunks.

Thanks!