# Marching Cube - polycount limit - chunks & seams

I’ve been writing my own (crude) Marching Cube algorithm for voxels to fit my project’s specific needs.

After tons of research, I understand the basics so everything’s going relatively well (despite my code not looking AT ALL like the ones I’ve seen on the internet). However, there’s one thing I can’t seem to find documentation or theories on:

Unity has a 65k vert limit per mesh. To my understanding, I can’t fit enough detail of large and complex objects (like terrain) into a single mesh. It seems like the natural course of action would be to separate it into chunks of multiple meshes.

Fair enough, but doesn’t that mean that, when the surface of the object isn’t perfectly flat, that there would be visible seams between these chunks due to the different normals of the vertices that are on the edges? How does one rectify this? Nobody seems to be talking about that.

Any insights would be awesome! Thanks!

I have no experience in this at all but I think the mesh separations would fit nicely where there is natural ‘seams’ in environments. Where the rock meets the dirt, where the dirt meets the field, where the field turns to grass etc.
Just a thought.

Hmm… that seems harder to control but it’s not impossible; I’ll give it a shot.

From what I’ve seen, though, most people that use Marching Cubes work in a grid.

One way might be to redraw the mesh using vertices that are within a distance from the player so that any seam created would be in the distance, but that doesn’t seem efficient.

Separate meshes can be seamless. But to do so, you need to be certain that the duplicated verts at the shared edge contain literally the same bits. So, calculate your positions and normals once, then copy them from the shared source to the separate meshes. That way, when you do your transforms and lighting, both copies of the verts will deterministicly calculate exactly the same results. Visually, it will be exactly the same image as if they were a single mesh.

Thanks!

So now I just have to look into generating normals by script; I was still using mesh.RecalculateNormals();

That narrows my search down a lot!