Triplanar Shader

What is Triplanar Mapping?

Triplanar mapping is a technique for applying a texture to a surface without the need for UV coordinates. It works by projecting the texture onto the surface from three different axes (X, Y, and Z) and blending the resulting texture coordinates together based on the surface normal.

No UV Coordinates Required

Screenshot showing a surface with triplanar mapping applied

One of the benefits of triplanar mapping is that it does not require UV coordinates to be set up on the mesh. This can be helpful in cases where the mesh does not have UVs, or where setting up UVs would be time-consuming or impractical.

Continuous Mapping

Screenshot showing a surface with triplanar mapping applied and the texture appearing seamless

Triplanar mapping can also provide seamless, continuous texture mapping across a surface. This can be especially useful for tiling textures or for surfaces that have complex curvature or topology, where traditional UV mapping techniques might struggle to achieve good results.

Adjustable Blending

Screenshot showing a surface with triplanar mapping applied and the texture blending smoothly across the surface

Triplanar mapping allows for precise control over the way that the textures are blended together. By using the surface normal as a blending factor, it is possible to achieve smooth transitions and a more natural-looking result.

Works with Any Shader

Screenshot showing a surface with a diffuse shader and triplanar mapping applied

Triplanar mapping can be used with any shader, including complex shaders like PBR shaders. In this example, a simple diffuse shader is used as a base, with triplanar mapping applied to add texture and detail to the surface.