A small change for improved Terrain (shading and traversal)

Hi,
i’ve posted this a decade ago ( Terrain - Bad Subdivision ), but the terrain still hasn’t changed in that regard, so i’m posting this again, as it still is very much the same issue:

The issue:
The built-in terrain uses the simplest repeating pattern for constructing triangles, which creates shading issues on edges and movement artifacts when traversing those bumps with no way to easily get rid of them (smoothing away one triangle raises another). The only way to work around this currently, is to use very high resolution terrain and with forcibly oversmoothed edges.


(current terrain, smooth in one direction)


(current terrain, jagged edges in the other direction)

The solution:
Interestingly a single, probably even small change can fix this, just alternating the direction when constructing the triangles (flipping every odd quad).
This means it’s not a breaking change and doesn’t introduce platform dependent features or anything else that could be considered a blocker as far as i can see.

But it would finally make the terrain smoothable in both directions.

To the Unity terrain/worldbuilding team: please consider implementing this improvement.

Here are a some screenshots from the old thread for an easier overview of the issue:

7 Likes

@Flavelius , thank you for bringing this up and it does appear to be a pretty elegant solution for this specific problem. We’ll take a look and consider the prioritization of this type of fix and how this would have to get implemented in the terrain system against the rest of the backlog for improvements.

4 Likes

Please document and release source for what you decide. Several of my assets assume a fixed triangle scheme and will have to reconstruct what the Unity terrain does in the shader. If it’s just flipping every other one it’s fairly trivial, but an even better impimentation would decide which way to flip based on the height map data.