Materials

An outline of how the material rendering pipeline functions in Voxel Plugin 2.

This article outlines how the material system works, as well as its limitations. It does not go into detail on how to use the system and build materials for it. For that, see the Landscape Pipeline Example Content.

Nanite Tesselation is disabled by default. Add the following lines to your project's DefaultEngine.ini to enable it:

  • r.Nanite.AllowTessellation=1

  • r.Nanite.Tessellation=1

How Materials Are Drawn

The current solution to material rendering has two components:

  • Pixel Shader Material

    • This is used for:

      • Shading terrains with Nanite enabled.

    • Any (opaque) material can be drawn anywhere.

    • One material is drawn per pixel - soft layer blends are not possible.

      • This uses Nanite's standard shading pipeline.

      • Which material is drawn where is affected by the Voxel Displacement configured in the Fallback Material.

  • Fallback Material

    • This is used for:

      • Controlling Voxel Displacement. This affects Pixel Shader blending and displacement.

      • Shading non-Nanite terrains.

      • Rendering the Lumen Surface Cache.

    • The same logic has to be used for the entire terrain.

      • This means that non-Nanite rendering and, more importantly, height blending and displacement, do not automatically match the Pixel Shader Material.

Texture Array & Texture Builder

As outlined above, the Fallback Material cannot use an "any material anywhere" approach. Instead, it uses a more traditional multi-layer setup.

To make it possible to access textures and properties assigned on terrain layers in the fallback material, the plugin can automatically gather texture and float-based parameters from any Pixel Shader Materials used.

Any parameters in the Fallback Material prefixed with INSTANCE_ will be collected. Scalars and vector parameters are written into textures. Texture parameters are compiled into a texture array. Note that the use of texture arrays means all textures being collected need to have the same compression format.

Last updated