Shading 2
Specular Term (Blinn-Phong)
V close to mirror direction ⇔ half vector near normal

Increasing p narrows the reflection lobe
一般p取到100~200
Ambient Term
Shading that does not depend on anything
• Add constant color to account for disregarded illumination and fill in black shadows
• This is approximate / fake!

Shading Frequencies
Shade each triangle (flat shading)
Flat shading 逐平面
• Triangle face is flat — one normal vector
• Not good for smooth surfaces

Shade each vertex (Gouraud shading)
Gouraud shading 逐顶点
• Interpolate colors from vertices across triangle
• Each vertex has a normal vector (how?)

Shade each pixel (Phong shading)
Phong shading 逐像素
• Interpolate normal vectors across each triangle
• Compute full shading model at each pixel
• Not the Blinn-Phong Reflectance Model

Defining Per-Vertex Normal Vectors
Best to get vertex normals from the underlying geometry
• e.g. consider a sphere

Otherwise have to infer vertex normals from triangle faces
从这个顶点相邻的几个面的法线来求平均值


Defining Per-Pixel Normal Vectors
Barycentric interpolation (introducing soon) of vertex normals

Don’t forget to normalize the interpolated directions
Graphics (Real-time Rendering) Pipeline 图形管线
各个部分内容所对应的渲染管线的流程






Texture Mapping
Surfaces are 2D, 纹理是一张图
Surface lives in 3D world space
Every 3D surface point also has a place where it goes in the 2D image (texture).

Each triangle “copies” a piece of the texture image to the surface.
Each triangle vertex is assigned a texture coordinate (u,v)
每个三角形的顶点都被映射到纹理坐标上

纹理可以被多次使用(上下相连的tiled)