modularMat
Shortcuts:
- mm
material
modularMat
RayTK
v0.42
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 | |
|
Inputs
-
SDF
: (required)- Coordinate Types:
float
vec2
vec3
vec4
- Context Types:
Context
- Return Types:
Sdf
- Coordinate Types:
-
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
- Coordinate Types:
-
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
- Coordinate Types:
-
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]
- Coordinate Types:
-
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]
- Coordinate Types:
-
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]
- Coordinate Types:
-
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]
- Coordinate Types:
-
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]
- Coordinate Types:
Variables
-
Light Color
: -
Light Position
: -
Surface Color (r, g, b, is set)
: -
Surface UV (u, v, w, is set)
: -
Ambient Occlusion
: -
Shaded Level (0: full shadow, 1: none)
: -
Surface Normal
: -
Reflection Color
: -
SDF Surface
: