litSpecular
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).
Parameters
Section titled “Parameters”normal
Section titled “normal”Node <"vec3">
Surface normal
lightDir
Section titled “lightDir”Node <"vec3">
Direction to light
viewDir?
Section titled “viewDir?”Vec3Input = ...
Direction to camera/viewer (default: straight up/forward)
lightColor?
Section titled “lightColor?”Vec3Input = ...
Light color
attenuation?
Section titled “attenuation?”FloatInput = 1
Light attenuation
shininess?
Section titled “shininess?”FloatInput = 32
Specular power/tightness (higher = smaller, sharper highlight)
specularStrength?
Section titled “specularStrength?”FloatInput = 0.5
Specular intensity multiplier
Returns
Section titled “Returns”Node <"vec3">
Specular highlight color (vec3, add to diffuse result)
Example
Section titled “Example”const spec = litSpecular(normal, light.direction, viewDir, light.color, light.attenuation, 32, 0.5)