learn-wgpu
learn-wgpu copied to clipboard
Incorrect specular highlight calculation
I am not a computer graphics expert by any means but I believe the specular term should not be multiplied by the color of the object.
The specular highlight often reflects the color of the light source, not the color of the reflecting object. This is because many materials have a thin layer of clear material above the surface of the pigmented material. For example, plastic is made up of tiny beads of color suspended in a clear polymer and human skin often has a thin layer of oil or sweat above the pigmented cells. Such materials will show specular highlights in which all parts of the color spectrum are reflected equally. On metallic materials such as gold the color of the specular highlight will reflect the color of the material. — https://en.wikipedia.org/wiki/Specular_highlight
The wiki page for the Phong reflection model also shows the specular component to be white (the color of the light).