I am using the Marching Cubes algorithm to create a chunk-based terrain system using the new editable meshes, but for some reason the meshes have weird shading around the edges as can be seen here:
This glitch is quite jarring when many chunks are placed next to each other, but I can’t figure out why it happens.
Initially I thought it had something to do with the normals, but experimenting with that and setting the normal of each vertex to 0, 1, 0 did not resolve the issue or make it less noticeable.
Then I tried changing the UV coordinates, but that also didn’t have any effect.
DoubleSided is false, I’ve made sure to get the winding order of the triangles consistent
Perhaps this is because of some weird triangle formations?
As you can probably tell, I am pretty lost. Any help is appreciated!
Yea the images I’ve provided makes the mesh look like a 2D plane which I’ve extruded but that’s not the case
I’m using an algorithm called marching cubes for creating a triangle mesh out of some 3D noise (hence the strange wireframe), which will allow me to support stuff like underground tunnels and so on, stuff that wouldn’t be possible by just extruding a plane
I’ll keep trying some stuff to see if it has any effect, but thanks for your answer nonetheless
Ended up calculating all the normals myself, which I’ll have to find a way to optimize, but the thing that was confusing me was that you have to set the vertex normals after you create the triangle. Oops