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.
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)