top of page

Triplanar Blending/ Projection

  • jamesghholt
  • Apr 26, 2022
  • 2 min read

Updated: May 18, 2022

An alternative method to mapping which isn't dependent on the UV coordinates stored per-vertex in a mesh. Especially beneficial when utilised with complex, stretched geometry- such as terrain. Allowing for more steep inclines and complex shapes; which are usually impossible for monoplanar mapping to handle. Triplanar mapping, boiled down to it's basics, is the projection of three textures along all three independent axis (X,Y,Z), and then blend these three samples based on the angle of the face. In theory, this method should combat stretched textures or hard seams, without the need of UV mapping.


However, triplanar mapping has its drawbacks. Normals rely on the meshes tangents cooperating with it's UV's. Instead we are using world coordinates. Normal maps can still be used to create lighting variation to the surface, but these normals will be incorrect. I believe normals can be tweaked to fix this, but I'm not versed in this area.


Additionally, three texture lookups are required, unlike the one needed for monoplanar UV's. This, blending and determining UV coordinates isn't too taxing on performance. However, the number of samples can rack up quickly. Three textures each for; specular, roughness, metallic, normal, etc.


The first rendition of triplanar projection I attempted was inefficient and unoptimised. Furthermore, if I was to include other maps; normal, roughness and metallic (which we fortunately aren't using for our project), this method of triplanar blending would get extremely overwhelming and complex - very quickly. It could be broken down into material functions, even then, my later method is much better.



Fraser Hutchinson suggested this method of triplanar blending. Which stems from the use of material functions. Having the upsides of efficiency and quick, simple texture input.


An example of terrain mapped through monoplanar UV mapping:

Terrain mapped through triplanar projection:


Triplanar projection can be blended in a multitude of ways, which can be advantageous to its chosen texture. For example, noisy textures such as rock and grass benefit from a highly blended texture, whereas something like brick would not. Other forms of blending also have their own benefits, as seen below, "Asymmetric Triplanar Blend" suits the forms of the bricks.


"Height Map Triplanar Blend" is my personal favourite blending solution. Using the height data of the texture, which we unfortunately don't have for our game, the texture can be blended accurately in relation to its bumps. A similar method would be using the texture luiminance, which can serve as decent approximations of height for some textures.



Triplanar blending wasn't suggested through any feedback, but when standing still (a rare commodity within our game) stretched textures became extremely obvious. Triplanar blending was more a necessity, than a need, for our landscape. The final result has enabled for some phenomal weight painting work from Harrison, taking the final product a leap forward in appearance. This necessity did however take very long to fully implement. The first rendition didn't take long to implement, but the second required plentiful tinkering alongside the landscape itself-- especially when blended into our landscape material.

References


 
 
 

Comments


©2022 by James Holt. Proudly created with Wix.com

bottom of page