Material Layers
ReferenceLayerShaders

MaskShader

Setup macros and layer variables used in MaskShaders.

Setup Macros

At the top of the vertex() function, declare SETUP_MASK_VERTEX.

At the top of the fragment() function, declare SETUP_MASK_FRAGMENT.

Layer Variables

A MaskShader can read LAYER_BLEND_* layer variables, referring to the Blend input of a MaskNode, and LAYER_BASE_* referring to the Base input of a MaskNode.

The LAYER_BASE_* layer variables return the accumulated properties of the layers from the Base input chain. The Blend input returns the properties of the SurfaceNode from the input chain. ( Blend input only takes in SurfaceNode )

Output and Input Variables

Material property variables.

Output VariablesBase VariablesBlend Variables
LAYER_OUT_ALBEDOLAYER_BASE_ALBEDOLAYER_BLEND_ALBEDO
LAYER_OUT_NORMAL_MAPLAYER_BASE_NORMAL_MAPLAYER_BLEND_NORMAL_MAP
LAYER_OUT_ROUGHNESSLAYER_BASE_ROUGHNESSLAYER_BLEND_ROUGHNESS
LAYER_OUT_HEIGHTLAYER_BASE_HEIGHTLAYER_BLEND_HEIGHT
LAYER_OUT_AOLAYER_BASE_AOLAYER_BLEND_AO
LAYER_OUT_METALLICLAYER_BASE_METALLICLAYER_BLEND_METALLIC
LAYER_OUT_EMISSIONLAYER_BASE_EMISSIONLAYER_BLEND_EMISSION
LAYER_OUT_BENT_NORMALLAYER_BASE_BENT_NORMALLAYER_BLEND_BENT_NORMAL
LAYER_OUT_MESH_NORMAL_MAPLAYER_BASE_MESH_NORMAL_MAPLAYER_BLEND_MESH_NORMAL_MAP
LAYER_OUT_MESH_AOLAYER_BASE_MESH_AOLAYER_BLEND_MESH_AO
LAYER_OUT_MESH_HEIGHTLAYER_BASE_MESH_HEIGHTLAYER_BLEND_MESH_HEIGHT
LAYER_OUT_MESH_CURVATURELAYER_BASE_MESH_CURVATURELAYER_BLEND_MESH_CURVATURE
LAYER_OUT_MESH_THICKNESSLAYER_BASE_MESH_THICKNESSLAYER_BLEND_MESH_THICKNESS

Input Variables

Data variables read from layers below.

Vec4 VariablesFloat Variables
LAYER_BELOW_TEX_0LAYER_BELOW_MASK_0
LAYER_BELOW_TEX_1LAYER_BELOW_MASK_1
LAYER_BELOW_TEX_2LAYER_BELOW_MASK_2
LAYER_BELOW_TEX_3LAYER_BELOW_MASK_3
LAYER_BELOW_TEX_4LAYER_BELOW_MASK_4
LAYER_BELOW_TEX_5LAYER_BELOW_MASK_5
LAYER_BELOW_TEX_6LAYER_BELOW_MASK_6
LAYER_BELOW_TEX_7LAYER_BELOW_MASK_7
LAYER_BELOW_TEX_8LAYER_BELOW_MASK_8
LAYER_BELOW_TEX_9LAYER_BELOW_MASK_9
LAYER_BELOW_TEX_10LAYER_BELOW_MASK_10
LAYER_BELOW_TEX_11LAYER_BELOW_MASK_11
LAYER_BELOW_TEX_12LAYER_BELOW_MASK_12
LAYER_BELOW_TEX_13LAYER_BELOW_MASK_13
LAYER_BELOW_TEX_14LAYER_BELOW_MASK_14
LAYER_BELOW_TEX_15LAYER_BELOW_MASK_15
YoutubePatreonDocsAssetsTwitter

©2026 Foyezes