Skip to content

Commit bf25cc2

Browse files
committed
add task1
1 parent 976274a commit bf25cc2

File tree

104 files changed

+56283
-136
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+56283
-136
lines changed

Notes.md

Lines changed: 68 additions & 59 deletions
Large diffs are not rendered by default.

Notes10.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
凹凸贴图的进化版 位移贴图( Displacement mapping )
1414

1515
### 球体映射到立方体
16-
![image](https://github.com/lumixraku/NotesForGraphics/raw/master/images/texture10.png)
16+
![image](https://raw.githubusercontent.com/lumixraku/NotesForGraphics/master/images/texture10.png)
1717

1818

1919
### 位移贴图
20-
![image](https://github.com/lumixraku/NotesForGraphics/raw/master/images/texture11.png)
20+
![image](https://raw.githubusercontent.com/lumixraku/NotesForGraphics/master/images/texture11.png)
2121

2222
位移贴图真的移动了顶点, 凹凸贴图只是改了法线,那么在物体的边缘上就会穿帮(边缘还是很光滑)
2323

@@ -35,7 +35,7 @@ f(x, y, z) = 0
3535

3636
不容易看出物体张啥样, 但是可以通过表达式 =0 >0 <0 判断出点在物体外还是物体内
3737

38-
![image](https://github.com/lumixraku/NotesForGraphics/raw/master/images/geometry1.png)
38+
![image](https://raw.githubusercontent.com/lumixraku/NotesForGraphics/master/images/geometry1.png)
3939

4040
### 显式表示
4141

@@ -47,11 +47,11 @@ R^2 => R^3 二维到三维的映射
4747

4848
虽然很容易看出图形的形状, 但是却不好判断点是否在图形内还是外
4949

50-
![image](https://github.com/lumixraku/NotesForGraphics/raw/master/images/geometry2.png)
50+
![image](https://raw.githubusercontent.com/lumixraku/NotesForGraphics/master/images/geometry2.png)
5151

5252
### 构造实体几何 CSG
5353

54-
![image](https://github.com/lumixraku/NotesForGraphics/raw/master/images/geometry3.png)
54+
![image](https://raw.githubusercontent.com/lumixraku/NotesForGraphics/master/images/geometry3.png)
5555

5656
## 距离函数
57-
![image](https://github.com/lumixraku/NotesForGraphics/raw/master/images/distance.png)
57+
![image](https://raw.githubusercontent.com/lumixraku/NotesForGraphics/master/images/distance.png)

Notes11.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
如何用三角形面来表示物体呢?
88
和编译出来的 obj 不一样, 这里的 obj 是文本文件
9-
![image](https://github.com/lumixraku/NotesForGraphics/raw/master/images/geometry4.jpg)
9+
![image](https://raw.githubusercontent.com/lumixraku/NotesForGraphics/master/images/geometry4.jpg)
1010

1111
这里描述的是一个立方体, 所以有 8 个顶点v.
1212
另外还描述了 6 个法线vn (因为有公用所以重复了2个).
@@ -17,7 +17,7 @@
1717
用一系列控制点去定义曲线
1818

1919

20-
![image](https://github.com/lumixraku/NotesForGraphics/raw/master/images/bezier.jpg)
20+
![image](https://raw.githubusercontent.com/lumixraku/NotesForGraphics/master/images/bezier.jpg)
2121

2222
给定三个点: 生成二次贝塞尔曲线
2323

@@ -32,7 +32,7 @@ https://github.com/venshine/BezierMaker
3232

3333
对于4个控制点的情形:
3434

35-
![image](https://github.com/lumixraku/NotesForGraphics/raw/master/images/bezier1.jpg)
35+
![image](https://raw.githubusercontent.com/lumixraku/NotesForGraphics/master/images/bezier1.jpg)
3636

3737
从原来4个点 3条线段(b0b1 b1b2 b2b3)
3838

@@ -42,7 +42,7 @@ https://github.com/venshine/BezierMaker
4242

4343
### 算法的数学表示
4444

45-
![image](https://github.com/lumixraku/NotesForGraphics/raw/master/images/bezier2.jpg)
45+
![image](https://raw.githubusercontent.com/lumixraku/NotesForGraphics/master/images/bezier2.jpg)
4646

4747
t = 0的时候 就应该是b0 t = 1 的时候 就是 b1
4848

@@ -51,26 +51,26 @@ t = 0的时候 就应该是b0 t = 1 的时候 就是 b1
5151
但是其他变换不行, 比如投影变换
5252

5353
### 凸包性质:
54-
![image](https://github.com/lumixraku/NotesForGraphics/raw/master/images/bezier3.jpg)
54+
![image](https://raw.githubusercontent.com/lumixraku/NotesForGraphics/master/images/bezier3.jpg)
5555
画出的贝塞尔曲线一定在控制点形成的凸包内
5656

5757

5858
一般人们习惯使用4个控制点去定义一条曲线, 下面这个曲线由多段贝塞尔曲线构成
5959

60-
![image](https://github.com/lumixraku/NotesForGraphics/raw/master/images/bezier4.jpg)
60+
![image](https://raw.githubusercontent.com/lumixraku/NotesForGraphics/master/images/bezier4.jpg)
6161

6262

6363
为了保证多个贝塞尔曲线的光滑性质 新增的线段的控制点要和原先最后两个的控制点形成的线段共线 , 且长度相等.
6464

65-
![image](https://github.com/lumixraku/NotesForGraphics/raw/master/images/bezier5.jpg)
65+
![image](https://raw.githubusercontent.com/lumixraku/NotesForGraphics/master/images/bezier5.jpg)
6666

6767
## 贝塞尔曲面
6868
相当于 x 方向 和 y 方向都有贝塞尔曲线.
6969
总共 4 * 4 = 16 个点来控制一小段曲面
7070

71-
![image](https://github.com/lumixraku/NotesForGraphics/raw/master/images/bezier6.jpg)
71+
![image](https://raw.githubusercontent.com/lumixraku/NotesForGraphics/master/images/bezier6.jpg)
7272

73-
![image](https://github.com/lumixraku/NotesForGraphics/raw/master/images/bezier7.jpg)
73+
![image](https://raw.githubusercontent.com/lumixraku/NotesForGraphics/master/images/bezier7.jpg)
7474
这里曲面中的 u v 就相当于之前提到的 t
7575

7676
贝塞尔曲面是显示表示, 因为是参数映射

Notes12.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Lecture 12 Gemometry3
22

33
## Mesh Process
4-
![image](https://github.com/lumixraku/NotesForGraphics/raw/master/images/mesh1.png)
4+
![image](https://raw.githubusercontent.com/lumixraku/NotesForGraphics/master/images/mesh1.png)
55

66
subdivision 细分
77
regularization 正规化 使用相同的三角形来表达
@@ -11,14 +11,14 @@ regularization 正规化 使用相同的三角形来表达
1111

1212
Loop 细分: 先细分, 再调整 (但是 Loop 细分至适用于三角形网格)
1313

14-
![image](https://github.com/lumixraku/NotesForGraphics/raw/master/images/mesh2.png)
14+
![image](https://raw.githubusercontent.com/lumixraku/NotesForGraphics/master/images/mesh2.png)
1515

1616
新顶点的位置 (图中白点为例子) 是原来 ABCD 取加权平均得到
1717

1818

1919
旧顶点的位置
2020

21-
![image](https://github.com/lumixraku/NotesForGraphics/raw/master/images/mesh3.png)
21+
![image](https://raw.githubusercontent.com/lumixraku/NotesForGraphics/master/images/mesh3.png)
2222

2323
旧顶点的新位置由周围的顶点位置 和 自己原来的位置 共同决定.
2424
n 表示顶点的度
@@ -27,11 +27,11 @@ u 是和顶点的度有关的一个数
2727
### Catmull - Clark 细分
2828
由于Loop 只能用在三角形网格, 对于四边形网格怎么办呢?
2929

30-
![image](https://github.com/lumixraku/NotesForGraphics/raw/master/images/mesh4.png)
30+
![image](https://raw.githubusercontent.com/lumixraku/NotesForGraphics/master/images/mesh4.png)
3131

3232
在面中间取一个点
3333

34-
![image](https://github.com/lumixraku/NotesForGraphics/raw/master/images/mesh5.png)
34+
![image](https://raw.githubusercontent.com/lumixraku/NotesForGraphics/master/images/mesh5.png)
3535

3636
在非四边形面内加上点, 是奇异点 (本次操作相比之前, 原来三角形面中间有两个度是3的点)
3737

@@ -49,7 +49,7 @@ u 是和顶点的度有关的一个数
4949

5050
### 二次误差度量
5151

52-
![image](https://github.com/lumixraku/NotesForGraphics/raw/master/images/mesh6.png)
52+
![image](https://raw.githubusercontent.com/lumixraku/NotesForGraphics/master/images/mesh6.png)
5353

5454
引入一个新的点, 使得这个点和 原来相关连的点所在的面 的距离 平方和 最小
5555

@@ -69,14 +69,14 @@ u 是和顶点的度有关的一个数
6969
2. 从摄像机出发, 看到的场景再投射回光源, 计算深度(点到光源的距离, 不考虑被遮挡)
7070
3. 对比两个距离, 如果不一样, 表示存在遮挡(阴影).
7171

72-
![image](https://github.com/lumixraku/NotesForGraphics/raw/master/images/shadow.png)
72+
![image](https://raw.githubusercontent.com/lumixraku/NotesForGraphics/master/images/shadow.png)
7373

74-
![image](https://github.com/lumixraku/NotesForGraphics/raw/master/images/shadow2.png)
74+
![image](https://raw.githubusercontent.com/lumixraku/NotesForGraphics/master/images/shadow2.png)
7575

76-
![image](https://github.com/lumixraku/NotesForGraphics/raw/master/images/shadow3.png)
76+
![image](https://raw.githubusercontent.com/lumixraku/NotesForGraphics/master/images/shadow3.png)
7777

7878
本影Umbra 半影PreUmbra 和光源大小有关.
7979

8080
软阴影 硬阴影 区别: 硬阴影的边缘很锐利, 清晰.
8181

82-
![image](https://github.com/lumixraku/NotesForGraphics/raw/master/images/shadow4.png)
82+
![image](https://raw.githubusercontent.com/lumixraku/NotesForGraphics/master/images/shadow4.png)

Notes13.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,27 @@
66

77
一般认为光栅化是属于快速近似. 并不是那么精细. 而光线追踪追求更加真实.
88

9-
![image](https://github.com/lumixraku/NotesForGraphics/raw/master/images/raytracing3.png)
9+
![image](https://raw.githubusercontent.com/lumixraku/NotesForGraphics/master/images/raytracing3.png)
1010

1111
glossy 表示有点反光, 但是又有些粗糙的物体 (铜镜)
1212

1313

1414

1515
早期人类认为人能看见物体, 是因为眼睛发出光线, 看到物体之后再返回来. 这和现在的常识不符.
1616

17-
![image](https://github.com/lumixraku/NotesForGraphics/raw/master/images/emmision.png)
17+
![image](https://raw.githubusercontent.com/lumixraku/NotesForGraphics/master/images/emmision.png)
1818

1919

2020
光线追踪是跟踪眼睛发出的光线( 这点似乎和常识有点不同, 是由于光路可逆 ) 到达物体的过程
2121

2222
光线的一个性质: 光路可逆 (也就是追踪的意思)
2323

24-
![image](https://github.com/lumixraku/NotesForGraphics/raw/master/images/raytracing4.png)
24+
![image](https://raw.githubusercontent.com/lumixraku/NotesForGraphics/master/images/raytracing4.png)
2525

2626

2727
沿着一根光线, 记录最近的交点
2828

29-
![image](https://github.com/lumixraku/NotesForGraphics/raw/master/images/raytracing.png)
29+
![image](https://raw.githubusercontent.com/lumixraku/NotesForGraphics/master/images/raytracing.png)
3030

3131
光线追踪因为 ray 是从眼睛( 摄像机 ) 发出, 因此天然的解决了遮挡(深度测试)的问题,
3232

@@ -36,22 +36,22 @@ glossy 表示有点反光, 但是又有些粗糙的物体 (铜镜)
3636

3737
Whitted Style: 多次递归反射, 就是在模拟光线在不断弹射的过程.
3838

39-
![image](https://github.com/lumixraku/NotesForGraphics/raw/master/images/raytracing2.png)
39+
![image](https://raw.githubusercontent.com/lumixraku/NotesForGraphics/master/images/raytracing2.png)
4040

4141
下面是一个玻璃球, 既有折射, 又有反射. 同时还要计算和光源的情况.
4242

43-
![image](https://github.com/lumixraku/NotesForGraphics/raw/master/images/raytracing5.png)
43+
![image](https://raw.githubusercontent.com/lumixraku/NotesForGraphics/master/images/raytracing5.png)
4444

4545
其实从这个图可以看到 光路有很多条, 最终我们要计算的是他们的和 (每条光路存在能量损失, 不然加起来光线亮度就很亮了)
4646

4747

48-
![image](https://github.com/lumixraku/NotesForGraphics/raw/master/images/raytracing6.png)
48+
![image](https://raw.githubusercontent.com/lumixraku/NotesForGraphics/master/images/raytracing6.png)
4949

5050

5151

5252
### 和球的交点
5353

54-
![image](https://github.com/lumixraku/NotesForGraphics/raw/master/images/raytracing7.png)
54+
![image](https://raw.githubusercontent.com/lumixraku/NotesForGraphics/master/images/raytracing7.png)
5555

5656
### 和显式表面怎么做呢?
5757
刚才 f(xx) = 0 是一个隐式表面的几何表达形式.
@@ -71,16 +71,16 @@ PS
7171

7272
通过法线 和某一个点 其实就定义了平面
7373

74-
![image](https://github.com/lumixraku/NotesForGraphics/raw/master/images/raytracing8.png)
74+
![image](https://raw.githubusercontent.com/lumixraku/NotesForGraphics/master/images/raytracing8.png)
7575

7676
两个向量点乘是0 表示相互垂直 (p' 是平面上任意一个点)
7777

7878

7979
和前面和球球交点问题一样, 交点即在平面上 有在光线上. 因此两个公式都满足.
80-
![image](https://github.com/lumixraku/NotesForGraphics/raw/master/images/raytracing9.png)
80+
![image](https://raw.githubusercontent.com/lumixraku/NotesForGraphics/master/images/raytracing9.png)
8181

8282
### 上面的方式是先和平面求交点, 再判断是否在三角形内. 有么有更加直接的办法呢?
83-
![image](https://github.com/lumixraku/NotesForGraphics/raw/master/images/raytracing10.png)
83+
![image](https://raw.githubusercontent.com/lumixraku/NotesForGraphics/master/images/raytracing10.png)
8484

8585
注意公式中的 1 - b1 -b2 , 点既然在三角形内, 那么这个点可以使用中心坐标去表示. (重心坐标的一个性质就是 b1+ b2 + b3 = 1)
8686

@@ -98,15 +98,15 @@ PS
9898

9999
上下左右前后 3对对面, 形成一个包围盒.
100100

101-
![image](https://github.com/lumixraku/NotesForGraphics/raw/master/images/aabb3.png)
101+
![image](https://raw.githubusercontent.com/lumixraku/NotesForGraphics/master/images/aabb3.png)
102102

103103

104104
先看2D 情况下的包围盒
105105

106106
光线射入, 记录下碰到对面1 的时间 和 离开对面2 的时间.
107107

108-
![image](https://github.com/lumixraku/NotesForGraphics/raw/master/images/aabb1.png)
108+
![image](https://raw.githubusercontent.com/lumixraku/NotesForGraphics/master/images/aabb1.png)
109109

110-
![image](https://github.com/lumixraku/NotesForGraphics/raw/master/images/aabb2.png)
110+
![image](https://raw.githubusercontent.com/lumixraku/NotesForGraphics/master/images/aabb2.png)
111111

112112
最终的包围盒中的射线, 是这三者求交集

Notes14.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@
44

55
与物体相交的格子标记为某一种类型 (右上角漏标记了)
66

7-
![image](https://github.com/lumixraku/NotesForGraphics/raw/master/images/accray.png)
7+
![image](https://raw.githubusercontent.com/lumixraku/NotesForGraphics/master/images/accray.png)
88

99

1010
假设: 光线和盒子相交很快, 光线和物体三角面求交很快.
1111

12-
![image](https://github.com/lumixraku/NotesForGraphics/raw/master/images/accray2.png)
12+
![image](https://raw.githubusercontent.com/lumixraku/NotesForGraphics/master/images/accray2.png)
1313

1414
因此很重要的是如何合理的将空间划分成各种格子. 如果这个光线经过的格子中有物体, 就要开始求光线和物体是否相交.
1515

1616
格子不能太密(不然光线和太多格子求交点效率低) 不能太稀疏(不然很容易要和格子中的物体求交点)
1717

1818

1919

20-
![image](https://github.com/lumixraku/NotesForGraphics/raw/master/images/accray3.png)
20+
![image](https://raw.githubusercontent.com/lumixraku/NotesForGraphics/master/images/accray3.png)
2121

2222
根据经验, 格子数 = 某个常数 * 空间中物体数
2323

@@ -29,7 +29,7 @@
2929

3030
## 空间切分
3131

32-
![image](https://github.com/lumixraku/NotesForGraphics/raw/master/images/spatial.png)
32+
![image](https://raw.githubusercontent.com/lumixraku/NotesForGraphics/master/images/spatial.png)
3333

3434

3535
### Oct-Tree
@@ -60,18 +60,18 @@
6060

6161
从空间开始划分
6262

63-
![image](https://github.com/lumixraku/NotesForGraphics/raw/master/images/kdtree.png)
63+
![image](https://raw.githubusercontent.com/lumixraku/NotesForGraphics/master/images/kdtree.png)
6464

6565

6666
如果光线和最外面的盒子有交点, 那么可能和子盒子有交点. 需要继续判断一下. 递归直到叶子节点.
6767

6868
如果一个子盒子是叶子节点, 光线就需要和这个叶子节点中的所有物体求交.
6969

70-
![image](https://github.com/lumixraku/NotesForGraphics/raw/master/images/kdtree1.png)
70+
![image](https://raw.githubusercontent.com/lumixraku/NotesForGraphics/master/images/kdtree1.png)
7171

72-
![image](https://github.com/lumixraku/NotesForGraphics/raw/master/images/kdtreeA.png)
72+
![image](https://raw.githubusercontent.com/lumixraku/NotesForGraphics/master/images/kdtreeA.png)
7373

74-
![image](https://github.com/lumixraku/NotesForGraphics/raw/master/images/kdtreeB.png)
74+
![image](https://raw.githubusercontent.com/lumixraku/NotesForGraphics/master/images/kdtreeB.png)
7575

7676
那么如何知道一个盒子和空间中的三角形面有交集呢?
7777

@@ -82,7 +82,7 @@
8282

8383
例如 t hit 这个位置的物体 和3个叶子节点相交
8484

85-
![image](https://github.com/lumixraku/NotesForGraphics/raw/master/images/kdtree3.png)
85+
![image](https://raw.githubusercontent.com/lumixraku/NotesForGraphics/master/images/kdtree3.png)
8686

8787

8888

@@ -93,7 +93,7 @@
9393

9494
从物体开始划分, 而不是从空间开始划分.
9595

96-
![image](https://github.com/lumixraku/NotesForGraphics/raw/master/images/bvh1.png)
96+
![image](https://raw.githubusercontent.com/lumixraku/NotesForGraphics/master/images/bvh1.png)
9797

9898
一堆三角形分为两堆, 左边的那一堆三角形又再次划分.
9999

@@ -102,13 +102,13 @@
102102
一个好处: 一个三角形只可能在一个包围盒中.
103103

104104

105-
![image](https://github.com/lumixraku/NotesForGraphics/raw/master/images/bvh2.png)
105+
![image](https://raw.githubusercontent.com/lumixraku/NotesForGraphics/master/images/bvh2.png)
106106

107107
这里的median 怎么理解呢? 就是不管按照何种方式去划分三角形, 最后划分出的两堆三角形数量差不多.
108108
(平衡树的概念, 避免树的深度过高, 这样查找起来才效率才高. )
109109

110110

111-
![image](https://github.com/lumixraku/NotesForGraphics/raw/master/images/bvh3.png)
111+
![image](https://raw.githubusercontent.com/lumixraku/NotesForGraphics/master/images/bvh3.png)
112112

113113
KD tree 是对空间划分, 物体可能即在左边又在右边
114114

@@ -126,15 +126,15 @@ BVH 是对物体划分(更形象点说是分组) 但是空间上组与组之间
126126

127127
描述光的功率: 流明 lm
128128

129-
![image](https://github.com/lumixraku/NotesForGraphics/raw/master/images/radiance.png)
129+
![image](https://raw.githubusercontent.com/lumixraku/NotesForGraphics/master/images/radiance.png)
130130

131131
- Radiant flux 辐射通量 (又称为 power)
132132
- Radiant intensity 辐射强度 (和方向有关)
133133
- irrediance 辐照度 (一个物体表面单位面积接收到的光的能量)
134134
- rediance 辐射 (光线在传播过程中度量能量)
135135

136136

137-
![image](https://github.com/lumixraku/NotesForGraphics/raw/master/images/radiance2.png)
137+
![image](https://raw.githubusercontent.com/lumixraku/NotesForGraphics/master/images/radiance2.png)
138138

139139
Radiant Intensity 是单位立体角上的power
140140

@@ -147,9 +147,9 @@ Radiant Intensity 是单位立体角上的power
147147

148148
立体角就是描述空间中角度有多大, 比如一个椎体张开的程度
149149

150-
![image](https://github.com/lumixraku/NotesForGraphics/raw/master/images/radiance3.png)
150+
![image](https://raw.githubusercontent.com/lumixraku/NotesForGraphics/master/images/radiance3.png)
151151

152152
单位立体角可以理解为 半径为1的二维球面上的一小块面积
153153

154-
![image](https://github.com/lumixraku/NotesForGraphics/raw/master/images/radiance3.png)
154+
![image](https://raw.githubusercontent.com/lumixraku/NotesForGraphics/master/images/radiance3.png)
155155
所有单位立体角的积分是 4π

0 commit comments

Comments
 (0)