News for hackers. Stuff that matters.
Re:Rendering my (billiard) balls in a fragment shader by the__alchemist on Sunday September 11, 2022 @03:48AM (#32797631)
Good timing - I was procrastinating on HN instead of trying to fix my phucked-up phong; you've helped me do both.
Re:Rendering my (billiard) balls in a fragment shader by sysrpl on Sunday September 11, 2022 @04:03AM (#32797720)
With a good phong it's all about the dot products and specular highlight (if you using highlights). Make sure you clamp the dot products and give yourself a minimum ambient light value of around 0.15 to 0.2.
Re:Rendering my (billiard) balls in a fragment shader by Jasper_ on Sunday September 11, 2022 @10:41AM (#32799989)
The thing that got me, in a classic Phong, you have to test whether dot > 0.0, it really won't work outside of the front hemiphere. The clamp isn't enough.