Open ghost opened 4 years ago
When discussing the Phong.fragshader the book mentions using clamp to limit the Phong RGB components to the 0.0-1.0 range.
Phong.frag
clamp
The actual clamp call seems to be missing from the shader code, however: https://github.com/gameprogcpp/code/blob/master/Chapter06/Shaders/Phong.frag
Adding this, the visual result is markedly different:
Phong = clamp(Phong, 0.0, 1.0);
Good catch, I actually don't remember whether that's intentional or if it was a mistake!
When discussing the
Phong.frag
shader the book mentions usingclamp
to limit the Phong RGB components to the 0.0-1.0 range.The actual
clamp
call seems to be missing from the shader code, however: https://github.com/gameprogcpp/code/blob/master/Chapter06/Shaders/Phong.fragAdding this, the visual result is markedly different: