litCelShaded
litCelShaded(
normal,lightDir,surfaceColor,lightColor?,attenuation?,bands?,shadowColor?):Node<"vec4">
Defined in: packages/nodes/src/lighting/lit.ts:128
Calculate cel-shaded (toon) lighting with hard bands.
Parameters
Section titled “Parameters”normal
Section titled “normal”Node <"vec3">
Surface normal
lightDir
Section titled “lightDir”Node <"vec3">
Direction to light
surfaceColor
Section titled “surfaceColor”Node <"vec4">
Base surface color
lightColor?
Section titled “lightColor?”Vec3Input = ...
Light color
attenuation?
Section titled “attenuation?”FloatInput = 1
Light attenuation
bands?
Section titled “bands?”FloatInput = 3
Number of shading bands (default: 3)
shadowColor?
Section titled “shadowColor?”Color of shadowed areas (default: darker version of surface)
Returns
Section titled “Returns”Node <"vec4">
Cel-shaded color (vec4)
Example
Section titled “Example”const toon = litCelShaded(normal, light.direction, inputColor, light.color, light.attenuation, 3)