Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
How are you setting your density? It looks like you're storing an int value, but your editTerrain function only adds volume, to dig, you'd need to remove volume. Making materials using marching cubes is non-trivial - generating the mesh starts requiring complicated blends, if you require more than 4 materials, you need to work out a material blending solution beyond RGBA filtering. As your marching cubes are offset from your scalar data, you may need 8 textures per cube.
If you're generating your textured road as a rectangle, then you're most of the way there. Your curve needs to be made up of trapezoid segments - the more you use, the smoother the curve effect will be.