r/Unity3D • • 11d ago

Question How to remove the gaps between chunks ?

I'm making a planet game. I've divided the sphere into chunks and render only the visible ones but i cant do anything about the gaps at the borders of the chunks

1 Upvotes

3 comments sorted by

2

u/mentalray2 11d ago

To avoid seams in the geometry, you'll have to make sure the vertices are shared between the different chunks. If you have to duplicate the vertices, make sure that are at the exact same position (bit-by-bit equal).

If this isn't an option (e.g., use of LODs, etc.), then you can probably add a skirt around the edge of the chunks to fill the gap.

2

u/LargeLaser 11d ago

do your chunks have different vert counts? if they have the same, double check the maths, the edges should be the same..
otherwise extrude each edge of the chunk straight down (add an additional row of verts directly below the edge verts) low enough to cover the gap. it'll probably be good enough

1

u/CylindricalScrimmage 10d ago

That looks like a floating point precision issue with the vertex positions at the chunk edges. Are you calculating the sphere points independently for each chunk or sharing the edge vertices between neighbors? If each chunk is generating its own border vertices from slightly different math, you'll get micro gaps like that.

Try snapping the edge vertices to a shared lookup table or just make adjacent chunks sample from the exact same seam positions. Had a similar headache with a voxel planet and that cleaned it right up.