Triplanar URP Terrain Shader

Hello everyone!
I am searching for a URP terrain shader, which does the following:

  • Triplanar mapping with mutliple textures (x,y,z different textures)
  • Unity Terrain: Splat mapping
  • Unity Terrain: Sculpting

Basically I am looking for the default TerrainLit shader with triplanar mapping.

I tried downloading all terrain shaders from the URP Repo and managed to use the downloaded TerrainLit shader from my Asset folder on a material, but couldn’t really figure out how and where to add the triplanar mapping part in the hlsl files that are referenced in the TerrainLit shader. Also, these shaders do not reference each other, but point to the Hidden shaders that are inbuilt into the URP.

I found a really nice triplanar mapping shader for non-URP, Unity 2017. It doesn’t work for the URP though and results in pink materials:

Does anyone know if there is a triplanar terrain shader for URP?
Thanks in advance, all help is appreciated :slight_smile:

Flo

1 Like

This is a great tutorial on tri-planar mapping. And, the web site is a gold mine for URP learning. Triplanar Mapping

Microsplat, or make one with a shader editor, its easy enough.

Have you ever found a shader for this?

I am thinking of converting to mesh and then using this tutorial

Microsplat (with the triplanar module) if you want flexibility and speed. Lux URP Essentials if you want simplicity and speed.

If you want to be able to customise the hell out of your terrain (maybe add some geo texturing to your triplanar, or some texture clustering?) then go straight for the Microsplat bundle - looks awesome and stays really performant (as long as you don’t go overboard laying on every single possible feature).

Easy option: get both! Even if you want the power of Microsplat, I’d still recommend getting Lux Essentials as well - it’s cheap and comes with a bunch of other nifty non-terrain shader.

2 Likes

Sounds good, do these work with latest 9.x.x. 10.x.x. URP?

I’m on URP 10 and yes, they both work. But bear in mind that URP 9 and 10 are not officially out so you possibly won’t get support for any issue that may arise with those pipelines. And I think certain things such as SSAO won’t yet work with some of the URP 10 shaders, until the devs are satisfied that the pipeline is out of preview and choose to make the necessary adjustments… so these shaders won’t yet benefit from you using 10 instead of 9. TLDR; For full support stick to URP 8.x but if you’re already on 9 or 10 then don’t fret because the shaders work. Plus both devs are top-notch and update their assets regularly to the latest official pipeline, bringing additional peace of mind.

1 Like