learn-wgpu icon indicating copy to clipboard operation
learn-wgpu copied to clipboard

Incorrect specular highlight calculation

Open Haksell opened this issue 6 months ago • 1 comments

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).

Haksell avatar Apr 29 '25 09:04 Haksell

I haven't gotten to this chapter myself so I'm not sure what the full context is, but in general there are cases where the color affects the specular color as well, such as metallic objects:

Image

these are both spheres with 0 roughness, but the one on the left is metallic and the right is not, rendered in blender with cycles. Phong is a pretty old model and I don't believe it has any accounting for such materials.

gentlecolts avatar May 05 '25 21:05 gentlecolts

Yeah I've been meaning to update to using PBR, I just haven't had the time.

sotrh avatar Jul 03 '25 23:07 sotrh