How to remove Unity 4 bumped terrain blending artifacts

Hi,

I am using Unity 4. I have 11 terrain materials, each with it’s own normal map set up. They are using a material set up with the [Nature/Terrain/Bumped Specular] shader. when I paint a single texture, it works perfectly (although the terrain is extremely shiny, unless I pull the specular level in the material way down, but I do want some shiny parts. What do I do?)

However, when there are multiple textures, the interface where they are supposed to blend has black/dark borders. The end result looks horrible. Is there any way to keep more than 4 textures and not have these blending artifacts?

screenshot of blending artifact:

[8744-blending+artefact.jpg|8744]

This problem is still there. It happens if you use more than 4 textures on the terrain - the fifth one you add always screws up and creates black rings around the boundary. This happens if you are using normal maps with your terrain textures. To reproduce:

  1. Create a terrain
  2. add 5 textures, each with their own normal map, to the terrain in the inspector.
  3. Create a Nature/Terrain/Bumped Specular
  4. Set above material as the material for the terrain in Terrain(inspector)/Settings[button]/Material.
  5. Paint intersecting part sof the terrain with the 5 materials.
  6. Notice that after 4 materials, the fifth will add dark boundary regions.

Please address this guys - it’s really impossible to use the terrain when every step of the way I end up with more bugs!

TerrBumpAddPass Replacement Shader

I made a replacement shader to help me overcome this problem (works well for me on a Windows desktop but I suspect it won’t work well on mobile devices).

It can blend over 8 textures without the blending artifacts you get with the default shader.

Details, screenshot comparison and download link (it’s free of course) all available at the following URL:

http://goo.gl/zXy29H

The replacement shader provided by method on march 2nd 2014 only reduced the problem for me, it didn’t solve it.

So I wrote my own replacement shaders, which you can get here.

The problem with the darkened ground (and in some case lightened), is caused by the way the normals are blended between splat maps.

Unity terrain uses splat map textures to indicate where each texture belongs. Textures only have 4 channels, so the 5th, 6th, 7th and 8th textures are drawn with a separate shader pass, which reads a separate splat map texture (same for the 9th, 10th, etc). Unfortunately the standard shaders only blend well with the other textures of the same splat map, so the lighting looks weird in the transition areas between splat maps.