Advertisement
Lucassim

Spec shader

Jul 18th, 2013
311
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.22 KB | None | 0 0
  1. vec3 halfAngle = normalize(cameraDir + lightDir);
  2. vec3 specularColor = min(lightColor[i] + 0.5, 1.0);
  3. float specularDot = dot(normal, halfAngle);
  4. specular += specularColor * pow(clamp(specularDot, 0.0, 1.0), 16.0) * distFactor;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement