Vertex Blend Triplanar Shader In Unity

Vertex Blend Triplanar Shader In Unity

When I first started using Unity, I was not satisfied with how terrain textures were blended together. Therefore I put together a vertex blend triplanar shader for Unity URP. It blends multiple textures using vertex colors from meshes, which allows us to bake splat maps onto meshes for direct texture application.

This shader uses triplanar mapping, blending multiple textures using the mesh’s vertex colors. It blends between textures with height maps to create customizable transitions and realistic terrain representation. It is suited for those who want to use meshes for terrains instead of Unity’s terrains.

  • Unity 2022.3.16f1LTS
  • URP 14.0.9
  • Shader Graph 14.0.9

The shader uses the same mask textures as in Unity’s Terrain engine.

Currently, the shader uses the R, G, and B channels to blend three textures. An additional Alpha channel can be incorporated for a fourth texture.

A procedurally generated cliff FBX file and textures are attached to this Repo as a demo. The cliff model was generated in Blender using its A.N.T Landscape addon, and the splat map was generated based on slope angles then applied to vertex colors.

Here is another example where you can use Unity’s Polybrush to paint vertex colors directly onto meshes with this shader.


You can download the shader from my Github.

Related Posts

80s Hairstyle In Unity

80s Hairstyle In Unity

I crafted a 80s hairstyle using Blender, adopting a common hair creation workflow often associated with ZBrush.

Read More
Anisotropic Highlight Hair Shader In Unity

Anisotropic Highlight Hair Shader In Unity

Hair models are commonly used in games, but Unity’s default URP materials did not achieve my desired results for hair shading.

Read More