Skip to content

Commit 2cdf0d6

Browse files
committed
add more to notes13
1 parent 8d305c8 commit 2cdf0d6

File tree

16 files changed

+246
-35
lines changed

16 files changed

+246
-35
lines changed

Notes13.md

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,23 @@ eye ray 永远考虑和场景中的物体最近的点 (完美解决了深度问
6565

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

68-
whitted style 是递归的
68+
whitted style 对于玻璃等电解质是递归的
69+
70+
在任意一个点可以继续传播射线,只要计算好反射和折射方向。
6971

7072
![image](https://raw.githubusercontent.com/lumixraku/NotesForGraphics/master/images/raytracing6.png)
7173

72-
在任意一个点可以继续传播射线,只要计算好反射和折射方向。
74+
7375

7476
![image](https://raw.githubusercontent.com/lumixraku/NotesForGraphics/master/images/raytracing10.jpg)
7577
在射线和物体的每一个交点,都和光源连线, 计算着色, 最终把这些着色加起来, 反映在像素点上。(被挡住的除外)
7678

79+
80+
Read More https://zhuanlan.zhihu.com/p/144403005
81+
82+
PS: 这里提到了 RayTracingInOneWeekend, 这本书中提到的 whitted style ray tracing 和经典的有些不同。zhihu文章也说到 经典的whited-style光线追踪遇到漫反射表面会直接利用blinn-phong模型计算颜色值返回,而不再递归下去。
83+
84+
7785
## 射线的定义
7886

7987
![image](https://raw.githubusercontent.com/lumixraku/NotesForGraphics/master/images/raytracing12.jpg)
@@ -193,4 +201,32 @@ Tenter Texit 是射线和盒子交汇的时机, 没有交点通过延长线求
193201

194202
如果 Texit < 0 表示没有交点 这里隐含的说明了 Tenter < 0 (因为 Tenter < Texit )
195203

196-
如果 Tenter < Texit 表示光线在盒子中停留过一段时间,可能有交点
204+
如果 Tenter < Texit 表示光线在盒子中停留过一段时间,可能有交点
205+
206+
# Read More
207+
208+
## 折射方向公式
209+
https://zhuanlan.zhihu.com/p/144403005
210+
211+
根据入射方向和法线, 两个不同介质的折射率,求出折射方向。
212+
213+
![image](https://raw.githubusercontent.com/lumixraku/NotesForGraphics/master/images/refraction.jpg)
214+
215+
可以简单的理解左半部分是空气 右半部分是某个折射率高于空气的物体。最终需要求出的就是折射方向
216+
217+
218+
![image](https://raw.githubusercontent.com/lumixraku/NotesForGraphics/master/images/refraction2.jpg)
219+
220+
221+
## Fresnel 菲涅尔反射
222+
描述了光线经过两个介质的界面时,反射和透射的光强比重。
223+
[Read More](https://www.zhihu.com/question/53022233)
224+
[Read More](https://zhuanlan.zhihu.com/p/31534769)
225+
226+
227+
## snell law 斯涅尔定律
228+
当光波从介质1传播到介质2时 入射光和法线的夹角θ1 折射光和法线夹角θ2 满足
229+
`n1*sinθ1=n2*sinθ2`
230+
231+
232+
wh

Notes7.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,15 @@ Shading is local. 着色是局部的.(每一个像素点独立运算)
3131

3232
![image](https://raw.githubusercontent.com/lumixraku/NotesForGraphics/master/images/shading.jpg)
3333

34-
35-
36-
3734
![image](https://raw.githubusercontent.com/lumixraku/NotesForGraphics/master/images/shading2.jpg)
3835

3936
兰伯特漫反射和观察角度无关 Independent of view direction
4037

4138
这里的大写字母 I 是光的强度
4239

4340
diffuse 扩散,Kd (diffuse coefficient) 漫反射系数 (基本上就是材质本身的颜色)
44-
![image](https://raw.githubusercontent.com/lumixraku/NotesForGraphics/master/images/shading3.jpg)
41+
![image](https://raw.githubusercontent.com/lumixraku/NotesForGraphics/master/images/shading3.jpg)
42+
43+
PS:这里入射光方向是指光源相对于这个点的方向,并不是光线射出的方向。
44+
45+
PS: 另外说明一下 max(0, N.I) 当光源从下方打到这个点的时候 N.I的点乘结果是小于0的 因为是兰伯特表面光照, 不考虑物体内部的光。

images/refraction.jpg

13.1 KB
Loading

images/refraction2.svg

Lines changed: 144 additions & 0 deletions
Loading

task3/MyTask3/task3.xcodeproj/xcshareddata/xcschemes/task3.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
isEnabled = "YES">
5757
</CommandLineArgument>
5858
<CommandLineArgument
59-
argument = "phong"
59+
argument = "bump"
6060
isEnabled = "YES">
6161
</CommandLineArgument>
6262
</CommandLineArguments>

0 commit comments

Comments
 (0)