Computes the Phong specular weight for a light source
# phongSpec = require(glsl-specular-phong)uniform vec3 eyePosition;uniform vec3 lightPosition;uniform float shininess;varying vec3 surfacePosition;varying vec3 surfaceNormal;void
Install with npm:
npm install glsl-specular-phong
Then use with glslify.
# phong = require(glsl-specular-phong)
Computes the specular power in the Phong lighting model.
lightDiris a unit length
vec3pointing from the surface point toward the light
eyeDiris a unit length
vec3pointing from the surface point toward the camera
normalis the surface normal at the sample point
shininessis the exponent in the Phong equation
float representing the specular power
(c) 2014 Mikola Lysenko. MIT License