bonsairobo / building-blocks

A voxel library for real-time applications.
MIT License
369 stars 30 forks source link

Two meshes at the same chunk in the LOD example #35

Closed Lemonzyy closed 3 years ago

Lemonzyy commented 3 years ago

In the LOD example, I found that two meshes are in the same location and overlap. I did not change any values in the configuration file. image

bonsairobo commented 3 years ago

This is most likely a bug with the clipmap algorithm.

bonsairobo commented 3 years ago

This code has since changed a lot. If we can't reproduce this soon, I'm going to close the issue.

bonsairobo commented 3 years ago

OK I actually managed to reproduce this, and reliably so. The trick is to quickly fly away from all of the terrain. Trying this enough times, it will reliably leave some chunks behind that never get despawned.

bonsairobo commented 3 years ago

Although I fixed the common cause of this by switching from a clip cube to a clip sphere, this is actually still possible by tunneling through an entire LOD.

Lemonzyy commented 3 years ago

image

bonsairobo commented 3 years ago

@Lemonzyy which revision is this from? I think I very recently fixed this bug.

bonsairobo commented 3 years ago

Oh wait, I guess this bug now only affects smooth meshes??? Weird... Or maybe it's only noticeable with smooth meshes.

Lemonzyy commented 3 years ago

@Lemonzyy which revision is this from? I think I very recently fixed this bug.

22c8aff8de763b46cbaa8a18ba6e1345503dd00f

bonsairobo commented 3 years ago

Huh so what's interesting about this new bug is that once you get overlapping meshes, e.g. the green that shouldn't be there, they don't go away until they leave the clip sphere. I would expect them to go away if you move around slowly and cause a split/merge.

bonsairobo commented 3 years ago

I think this is actually fixed now :crossed_fingers:

Closing until there is another repro after 7dcb50a27c5e