modularMat

Shortcuts:
  • mm

A material that is composed of one or more shading elements.

The shading contribution operators are intended to be used with this material, including diffuseContrib, specularContrib, and skyLightContrib. However any float or vector field operator can be used as a lighting element as long as it’s set up to use MaterialContext.

Parameters

Name Description Regular Handling Read-Only Handling
Enable
Base Color Runtime Baked
Use Light Color

Whether to apply the light color to the base color. This does not affect whether the shading elements use the light color.

Baked Baked
Use Local Position Baked Baked
Enable Ambient Occlusion Baked Baked
Enable Reflection Baked Baked
Apply When Runtime Baked
  • Always:
  • Only If Unassigned:

Inputs

  • SDF: (required)
    • Coordinate Types: float vec2 vec3 vec4
    • Context Types: Context
    • Return Types: Sdf
  • Color Contribution 1: (optional) First shading element.
    • Coordinate Types: float vec2 vec3 vec4
    • Context Types: MaterialContext
    • Return Types: float vec4
    • Supports Variables: lightcolor lightpos surfacecolor surfaceuv ao shadedlevel normal reflectcolor sdf
  • Color Contribution 2: (optional) Second shading element.
    • Coordinate Types: float vec2 vec3 vec4
    • Context Types: MaterialContext
    • Return Types: float vec4
    • Supports Variables: lightcolor lightpos surfacecolor surfaceuv ao shadedlevel normal reflectcolor sdf
    • Supports Variables From Inputs: shading1
  • Color Contribution 3: (optional) Third shading element.
    • Coordinate Types: float vec2 vec3 vec4
    • Context Types: MaterialContext
    • Return Types: float vec4
    • Supports Variables: lightcolor lightpos surfacecolor surfaceuv ao shadedlevel normal reflectcolor sdf
    • Supports Variables From Inputs: shading[1-2]
  • Color Contribution 4: (optional)
    • Coordinate Types: float vec2 vec3 vec4
    • Context Types: MaterialContext
    • Return Types: float vec4
    • Supports Variables: lightcolor lightpos surfacecolor surfaceuv ao shadedlevel normal reflectcolor sdf
    • Supports Variables From Inputs: shading[1-3]
  • Color Contribution 5: (optional)
    • Coordinate Types: float vec2 vec3 vec4
    • Context Types: MaterialContext
    • Return Types: float vec4
    • Supports Variables: lightcolor lightpos surfacecolor surfaceuv ao shadedlevel normal reflectcolor sdf
    • Supports Variables From Inputs: shading[1-4]
  • Color Contribution 6: (optional)
    • Coordinate Types: float vec2 vec3 vec4
    • Context Types: MaterialContext
    • Return Types: float vec4
    • Supports Variables: lightcolor lightpos surfacecolor surfaceuv ao shadedlevel normal reflectcolor sdf
    • Supports Variables From Inputs: shading[1-5]
  • Color Contribution 7: (optional)
    • Coordinate Types: float vec2 vec3 vec4
    • Context Types: MaterialContext
    • Return Types: float vec4
    • Supports Variables: lightcolor lightpos surfacecolor surfaceuv ao shadedlevel normal reflectcolor sdf
    • Supports Variables From Inputs: shading[1-6]

Variables

  • lightcolor:
  • lightpos:
  • surfacecolor:
  • surfaceuv:
  • ao:
  • shadedlevel:
  • normal:
  • reflectcolor:
  • sdf: