O'Reilly logo

WebGL Game Development by Sumeet Arora

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Understanding shading/interpolation models

We discussed earlier that information about the surface of a model, such as the positions of points on the surface and the normal vectors at those points, are stored only for each vertex of a triangle mesh. When a single triangle is rendered, information known at each vertex is interpolated across the face of the triangle. Sometimes we calculate the diffuse and specular illumination only at the vertices of a mesh, and at other times we apply the entire illumination formula at every individual pixel drawn in the display. A shading model defines whether we will apply the illumination model only for the vertex or apply the illumination model for every pixel of the face. If calculated at the vertex level, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required