Per-vertex normal and illumination

For smooth looking meshes, we define a normal per-vertex.
shading_sphere.png
illumination.png
Possible automatic computation of normals: averaged normals of surrounding triangle.
\(\displaystyle n_k = \frac{\sum_{j\in{\mathcal{V}_k}} \hat{n}_j}{\|\sum_{j\in{\mathcal{V}_k}} \hat{n}_j\|}\), \(\mathcal{V}_k\): neighboring triangles.
avg_normal.png
\(\color{blue}{n_k}\)
\(\color{red}{\hat{n}_j}\)