1 2 3 4
float blinnPhongSpecular( vec3 lightDirection, vec3 viewDirection, vec3 surfaceNormal, float shininess ) { vec3 H = normalize(viewDirection + lightDirection); return pow(max(0.0, dot(surfaceNormal, H)), shininess); }
You can clone a snippet to your computer for local editing. Learn more.