Triplanar mapping Unity Shader Graph


Enjoying the Shader Course so far, thanks.

You touch on tri-planar mapping on your Moss creation item, which is useful.

I was just wondering if you could possibly expand into tri-planar mapping discussion into terrain Shaders. I have seen developers use nice low poly tri-planar shaders which paint grass and rock simultaneously.

Advancenine (YouTube) uses a neat tri-planar shader for his terrain in Night Sones, but doesn’t share how to create it (which of course is quite reasonable). But I’d really like to know how to do that.

Could you help?


I haven’t played with tri-planar shaders, though I would love to create terrain shaders that paint a terrain based on slope and elevation (I’m terrible at painting terrains - heck even sculping them).

I’ll pass this on to Chris and see what he has to say.

Unfortunately, there’s not a lot of information available online related to replacing the default terrain shader in URP. I spoke with the guy from Nature Manufacture (asset store publisher with a lot of nature / terrain assets) and they said it was a nightmare to try to create one even using HLSL.

The only way that I know to figure out how to make a drop-in-replacement that supports all the features like picking up which texture is painted and with which opacity, the holes, etc… would be an exercise in reverse engineering the provided Terrain/Lit shader then adding the Triplanar mapping. While possible, very slow, very painful, and Unity could change it at any time without warning, breaking your shader.

Most of what I see people do instead of this reverse engineering is create a procedural material that automatically applies textures based on height and some other parameters. There’s an open source example of this here.

If you find a better answer anywhere in the depths of the internet I’d love to hear about it as well because this is something I’ve also wondered about.

Privacy & Terms