Skip to content

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.

Node <"vec3">

Surface normal

Node <"vec3">

Direction to light

Node <"vec4">

Base surface color

Vec3Input = ...

Light color

FloatInput = 1

Light attenuation

FloatInput = 3

Number of shading bands (default: 3)

Vec3Input

Color of shadowed areas (default: darker version of surface)

Node <"vec4">

Cel-shaded color (vec4)

const toon = litCelShaded(normal, light.direction, inputColor, light.color, light.attenuation, 3)