TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: Could anyone explain Phong shading in a relatively accessible way?

1 pointsby ComradeUlyanovabout 3 years ago
The Wikipedia article on the topic and the formula simply confuse me.

1 comment

Someoneabout 3 years ago
Please read and learn from <a href="http:&#x2F;&#x2F;www.catb.org&#x2F;~esr&#x2F;faqs&#x2F;smart-questions.html" rel="nofollow">http:&#x2F;&#x2F;www.catb.org&#x2F;~esr&#x2F;faqs&#x2F;smart-questions.html</a>. As is, we have to guess at what you know and don’t know.<p>My knowledge&#x2F;memory may be a bit rusty, but let’s try to do that (basically rephrasing Wikipedia, leaving out some details, but that sometimes helps). I’ll assume you know what triangles are ;-), what a triangular mesh is and what shading is.<p>With Gouraud shading, you compute the shading at each visible vertex of your model and interpolate the shading of all other points in each visible polygon from the shading of each of its vertices.<p>Computing shading involves computing a surface normal and, then, using a reflection model to compute what a given point looks like.<p>With Phong shading, you compute the surface normal at each visible vertex of your model, interpolate the surface normal of of all other points in each visible polygon from the surface normal of each of its vertices, and then compute the shading of each point using that surface normal.<p>That’s more work (you have to interpolate vectors, and, more importantly, have to apply your reflection model at each point, rather than only at each vertex), but gives better results.