diffuseColor
uniform, we introduced a second, the lightPosition
.surfaceColor
.Note that shading is happening in camera space. What would need to be changed to compute shading instead using a light that is at a fixed position in world space? (Hint: given the set of matrices Three.js provides, this is easy only if we know the modeling transformation is rigid.)