Appearance
INFO
There is an example available on this topic!
When Surface Types are assigned to the voxel world from a stamp, they are automatically tracked by the MegaMaterial. The materials used by the surface type are then combined into a single material, which branches to only evaluate the needed parts.
Voxel Worlds do not have mesh UVs. Textures should be sampled using world coordinates instead. Generally speaking, triplanar texture sampling (i.e. the stock WorldAligned material functions) are used for texturing Voxel Worlds. All standard material features (like Vertex Interpolators and Transform nodes) are supported in materials used on Voxel Worlds.
TIP
Materials should generally be built to represent a single surface type, i.e. only dirt, not dirt with rocks on the sides. For auto-material behaviors like having different textures for tops, bottoms and sides, make a single material for each of these, and use them in Smart Surface Types to achieve the auto-material behavior.
Whatever is plugged into a material's Displacement
pin is treated as height information for heightblends. It is also used for Nanite displacement.
INFO
Rendering translucent or single layer water materials are not supported in Surface Types. They can only be used when assigned as Custom material in the MegaMaterial.
Pixel Depth Offset and Masked Opacity are supported, but are disabled by default for performance reasons. They can be enabled in the MegaMaterial asset if needed.
Errors & Texture Count Limits
Because many materials are being combined, your terrain material may not render due to errors. Errors related to SRV and Sampler limits may appear. If you see errors like this, they can potentially be worked around by enabling Bindless Rendering.
Bindless Rendering can be enabled by adding the following lines to your project's DefaultEngine.ini, under the rendering section:
rhi.Bindless.Resources=Enabled
rhi.Bindless.Samplers=Enabled
DANGER
Bindless Rendering is in most contexts beneficial or neutral, but it is not well-tested and it is only supported on SM6-compatible systems.
Unfortunately, even with bindless rendering enabled, limits on texture usage continue to exist at various points in the renderer. There is not currently a solution to this.