Skip to content

litSpecular(normal, lightDir, viewDir?, lightColor?, attenuation?, shininess?, specularStrength?): Node <"vec3">

Defined in: packages/nodes/src/lighting/lit.ts:54

Calculate specular highlights (Blinn-Phong model).

Node <"vec3">

Surface normal

Node <"vec3">

Direction to light

Vec3Input = ...

Direction to camera/viewer (default: straight up/forward)

Vec3Input = ...

Light color

FloatInput = 1

Light attenuation

FloatInput = 32

Specular power/tightness (higher = smaller, sharper highlight)

FloatInput = 0.5

Specular intensity multiplier

Node <"vec3">

Specular highlight color (vec3, add to diffuse result)

const spec = litSpecular(normal, light.direction, viewDir, light.color, light.attenuation, 32, 0.5)