Phong Speculars
Next up, obviously, Phong’s speculars!
The specular reflection is a property of reflective materials. Specifically, it is the point at which light is fully reflected back to us.
We often see it as a dot of light in surfaces:
void main()
{
vec3 N = normalize(fragNormal);
vec3 L = normalize(lightDir);
vec3 viewDir = normalize(viewPos - fragPosition);
vec3 reflectionDir = reflect(L, N);
float onlySpecular = max(0, dot(viewDir, reflectionDir));
onlySpecular = pow(onlySpecular, smoothness * 100);
finalColor = vec4(vec3(onlySpecular), fragColor.a);
}
If you made it this far...
Thank you! I hope you liked it!
I do not allow comments in my blog because I do not want to deal with bots. However, feel free to contact me!
And if you would like to support my work, please, consider doing so through ko-fi:
Read other posts