- Real-Time 3D Graphics with WebGL 2
- Farhad Ghayour Diego Cantor
- 116字
- 2021-06-10 19:43:03
Phong Interpolation
The Phong method calculates the final color in the fragment shader. To do so, each vertex normal is passed from the vertex shader to the fragment shader using a varying. Because of the interpolation mechanism of varyings included in the pipeline, each fragment will have its own normal. Fragment normals are then used to calculate the final color in the fragment shader.
The following diagram summarizes the two interpolation models:
The shading method does not specify how the final color for each fragment is calculated. It only specifies where (vertex or fragment shader) and the type of interpolation (vertex colors or vertex normals) to be used.