Skip to content

Commit 862bae9

Browse files
committed
add lecture notes for shading in computer graphics
1 parent 5727dfa commit 862bae9

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
title: lecture08: Shading Shading
3+
date: 2024-12-20
4+
tags:
5+
- computer_graphics
6+
---
7+
8+
## Blinn-Phong reflectance model
9+
10+
### Specular term
11+
12+
高光项
13+
14+
接近镜面反射。也就是半程向量(h)和法线(n)接近,这是Blinn-Phong相对Phong模型的改进。
15+
16+
$L_s=k_s(I/r^2)\max(0,n\cdot h)^p$
17+
18+
### Ambient term
19+
20+
环境光照项
21+
22+
$L_a=k_aI_a$
23+
24+
$L=L_a+L_d+L_s$
25+
26+
ref:Radiometry
27+
28+
## Shading frequencies
29+
30+
着色频率:着色要应用在哪些点上。
31+
32+
面、顶点、每一个像素
33+
34+
- Flat shading:都是平面,不利于平滑
35+
- Gouraud shading:顶点进行着色,随后插值
36+
- Phong shading:对法线方向进行插值,随后对每个点进行着色
37+
38+
定义每一个顶点的法线:顶点法线是所有面的法线求平均。
39+
40+
更近一步,根据三角形面积进行加权平均。
41+
42+
定义每一个像素的法线:使用重心坐标系对顶点法向的插值
43+
44+
## Graphics pipeline

0 commit comments

Comments
 (0)