Computer graphics lighting: Difference between revisions

Content deleted Content added
m linking
m linking
Line 78:
 
=== Phong shading ===
[[Phong shading]], similar to Gouraud shading, is another type of interpolative shading that blends between vertex values to shade polygons<ref name=":13">{{Cite web|url=http://www.hao-li.com/cs420-fs2018/slides/Lecture05.2.pdf|title=Shading in OpenGL|last=Li|first=Hao|date=2018|website=|url-status=live|archive-url=|archive-date=}}</ref>. The key difference between the two is that Phong shading interpolates the [[vertex normal]] values over the whole polygon before it calculates its shading<ref name=":12" />. This contrasts with Gouraud shading which interpolates the already shaded vertex values over the whole polygon<ref name=":13" />. Once Phong shading has calculated the normal of a fragment (pixel) inside the polygon, it can then apply a lighting model, shading that fragment<ref name=":12" />. This process is repeated until each polygon of the 3D model is shaded<ref name=":13" />.
 
== Lighting effects ==