A blog about VFX, scripting, van renovation, and some other gubbins.

@henloco

Advanced Triplanar Material

Published 13th September 2023 by Henry

Triplanar material functions often overlook normal maps because they require correction in order to appear accurate.

This plugin includes clearly labelled, well-structured material functions which can be reused anywhere in your project for good-looking, accurate triplanar texturing.

Also includes demo materials with annotated material graph which explains how the functions are optimised for performance.

Includes:

  •  Material functions x2 (AdvancedTriplanar, AdvancedTriplanarInit)
  •  Demo Materials demonstrating triplanar capabilities
  •  Grunge and normal textures

Features:

  • RGBA triplanar output
  • Normals triplanar output, corrected
  • Switch for World or Local space triplanar

FreePBR.com

The demo materials use PBR textures from FreePBR.com which has over 500 high quality texture packs available to download. They are all fully compatible with this material function and I highly recommend them.

 

AdvancedTriplanarInit:

This function is used once within your material to calculate the triplanar mapping UVs, plane masks and a few other parameters. These can then be reused as many times as needed within your material in the other material function; AdvancedTriplanar

AdvancedTriplanar

This function takes the parameters from AdvancedTriplanarInit and applies them to a specified texture. This function can be used multiple times with different textures, but taking the same parameters from the init function. This is particularly useful for PBR materials where you may need to apply triplanar mapping to BaseColor, Occlusion, Roughness, Metallic and Normal.

 

How to use Advanced Triplanar Material Function

  1. Create a new material
  2. Add the material function AdvancedTriplanarInit
  3. Set the parameters and create Named Reroute Nodes for each of the outputs. This will allow you to re-use the values for multiple triplanar textures in your material.
  4. Now add the material function AdvancedTriplanar as many times as needed, once for each texture you intent to use.
  5. Pass in the named reroute nodes we just created, and each of the texture objects you will need. In the below example we have a BaseColor and a Normal:
  6. Connect the outputs of the AdvancedTriplanar functions to their corresponding material nodes (BaseColor and Normal).
  7. Save the material and create a material instance of it.
  8. Open the material instance and add your textures in the corresponding slots.
  9. Set the other parameters to your liking.
  10. Your material instance settings should now look similar to this:

That’s it! You have successfully created your first Advanced Triplanar material. Enjoy it!

 

 

 

 

Assets:

Master material: 1

Material instances: 3

Material functions: 2

Textures: 8 (all 2k resolution)

Supported Development Platforms:

Windows: Yes

Mac: Yes

More

Previous

Advanced MatCap Material

Next

Advanced Texture Bombing Material

Leave a Reply

Your email address will not be published. Required fields are marked *