My terrain is tiled, and each heightmap pixel on one edge is set to the height of the matching pixel on the other edge. However, there are holes in the resultant image where the edges meet. Shouldn’t it be seamless because each edge meets exactly?
for(int i=0; i<HMRES; i++){
fheights[i,256] = fheights[i,0];
fheights[256,i] = fheights[0,i];
}
fheights[256,256]=fheights[0,0];
Terrain.activeTerrain.terrainData.SetHeights(0,0,fheights);
Terrain.activeTerrain.SetNeighbors(Terrain.activeTerrain,Terrain.activeTerrain,Terrain.activeTerrain,Terrain.activeTerrain);
Original:
Furthermore, edges of the terrain are unusually illuminated (because shadows aren’t computed for the adjacent edge?). Is there any way to render the shadow correctly as well?
After adding SetNeighbors (retextured to show better):