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

Forgot a facing component #3

Open
mysteryDate opened this issue Jan 12, 2018 · 0 comments
Open

Forgot a facing component #3

mysteryDate opened this issue Jan 12, 2018 · 0 comments

Comments

@mysteryDate
Copy link

From http://developer.download.nvidia.com/CgTutorial/cg_tutorial_chapter05.html:

Additionally, the specular term is forced to zero if the diffuse term is zero because N · L (from diffuse lighting) is negative. This ensures that specular highlights do not appear on geometry that faces away from the light.

So line 9 should read:

return pow(step(0.0, dot(surfaceNormal, lightDirection)) * max(0.0, dot(viewDirection, R)), shininess);

Or something like that.

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