Editing voxels @ chunk borders

At the moment I’m also editing the neighboring chunk if the current voxel is at the end(or beginning) of its chunk. I know that there is more cases when we are editing at edges and corners of each chunk, but I’m not writing those until i get some clarification of whats going on here.

I’m using marching cubes for the mesh generation, if that makes a difference.
Maybe editing 1 voxel at the time is not possible with marching cubes if i want aligned geometry between chunks?

If someone checks in that have done this before, please give me some insight in how you handled cross-chunk editing.

alt text

Update #1:
I got way better results when i removed clamping of the voxel values…

chunk.voxels[ix,iy,iz] += mod;
				if(clampVals)
					Mathf.Clamp(chunk.voxels[ix,iy,iz],-1f,1f);

as u see i limited the values between -1f to 1f, i thought that was a good idea, but i wasn’t thinking of what values existed in there from the terrain noise, obviously those values wasn’t in that range (stupid me)

It looks like you found the solution already. I struggled with this also.

There are a few things that cause this:

  1. The algorithm for altering the data in adjacent chunks isn’t continuous/smooth (So the seams in neighboring meshes start to tear like this.)

  2. The algorithm you’re using for the density of the 3D array is not smooth (meaning the values of adjacent array elements are too far apart)

  3. The values you are using are outside the threshold for generating the polygons

Anyway, looks good.