Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chapter 6 - Phong.frag, missing clamp call #36

Open
ghost opened this issue Sep 7, 2020 · 1 comment
Open

Chapter 6 - Phong.frag, missing clamp call #36

ghost opened this issue Sep 7, 2020 · 1 comment

Comments

@ghost
Copy link

ghost commented Sep 7, 2020

When discussing the Phong.fragshader the book mentions using clamp 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.frag

Adding this, the visual result is markedly different:

 Phong = clamp(Phong, 0.0, 1.0); 
@chalonverse
Copy link
Contributor

Good catch, I actually don't remember whether that's intentional or if it was a mistake!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant