GAMES101 19,20,21,22 (完结)
19 Cameras, Lenses and Light Fields 相机棱镜和光场Camera Structure
shutter 快门
sensor 传感器,感知Irradiance
针孔相机 Pinhole Image Formation没有模糊
Feild of view (FOV) 视场取决于Lens和Sensor(宽度是h)的距离(f)。 $Fov=2 arctan(\frac{h}{2f})$
Exposure 曝光
$ H=T\times E$
exposure=time*irradiance
Aperture size 光圈(E)f数(F-Number F-STop)直径分之一,越大光圈越小。光圈大远景模糊,浅景深(景深是光像清晰的一段范围)
Shutter speed 快门曝光时间(T)Motion Blur 运动模糊
ISO Gain 感光度。太大放大噪声
F-Stop和Shutter时间要Trade off
Gauss Ray Tracing Construction / Thin lens equation$\fr ...
GAMES101 18 Advanced Topics in Rendering
18 Advanced Topics in RenderingAdvanced Light TransportUnbiased light transport methodsBidirectional Path Tracing (BDPT)生成两个子路径,分别从光源和摄像机出发光线,并将两者断电连接起来。
Metropolis Light Transport (MLT)
用马尔可夫链生成样本,给一条路径,生成一系列相似的路径。被积函数和pdf形状一致的时候variance最小。(马尔可夫链可以用任何函数生成样本)
适用于局部取样、复杂光路、焦散、SDS(Specular-Diffuse-Specular)
缺点是收敛速度问题不清楚、有些像素收敛快,有的慢
Biased light transport methodPhoton Mapping
caustics(焦散),
Step 1 Photon Tracing 光子一直跑,知道遇到diffuse的地方
Step 2 photon collecting 从视角跑,直到遇到diffuse的地方
Step 3 Calculation - ...
GAMES101 17 Material and Appearance
17 Material and AppearanceMaterial = BRDF
Diffuse / Lambertain Material
albedo (color): $f_r=\rho/\pi,albedo\ is\ \rho $
Glossy MaterialIdeal Reflective / Refractive Material 反射和折射材料Snell’s Law
Law of Refraction 斯涅尔定律(折射定律)
Snell’s Circle (水中的全反射,一个锥形)
Fresnel Reflection / Term 菲涅尔项
Reflectance depends on incident angle (and polarization of light)
不同角度反射和折射的量不同。也取决于光的偏振方向。但是太不好算了
菲涅尔项的approximation: schlick’s approximation
Microfacet Theory 微表面模型 基于物理
对于细节很多的材质。远 ...
GAMES101 16 Ray Tracing 4 Path Tracing
Ray Tracing 4 Path TracingMonte Carlo Integration
Definite intergral: $\int_{a}^{b}{f(x)dx}$
Random variable: $X_i\sim pdf(x)$ , pdf is the Probability Distribution Function
Monte Carlo estimator: $F_N=\frac{1}{N}\sum_{i=1}^{N}{\frac{f(x_i)}{pdf(x_i)}}$
我自己证明一下:中心极限定理,当 $ N\rightarrow \infty $
$\frac{1}{N}\sum_{i=1}^{N}{\frac{f(x_i)}{pdf(x_i)}}\rightarrow E(\frac{f(x_i)}{pdf(x_i)})$
$= \int_{a}^{b}{pdf(x_i)\times \frac{f(x_i)}{pdf(x_i)}}dx$
$=\int_{a}^{b}{f(x_i)}dx$
$& ...
GAMES101 15 Ray Tracing 3 BRDF
15 Ray Tracing 3 BRDFBasic Radiometry 辐射度量学基础Irradiance
Definition: Power pur unit area.
$ E(x) \equiv \frac{d\Phi_{\perp}(x)}{dA}=\frac{\Phi}{A}cos\theta $
单位面积上接收到的能量
Radiance
Definition: Power pur unit solid angle pur unit area
$L(p,\omega)\equiv \frac{d^2\Phi(p,\omega)}{d\omega dAcos\theta}$
单位立体角单位面积上接收到的能量
Radiance 对单位立体角积分,就是Irradiance:
$E_i(\omega_i)=L_i(\omega_i)cos\theta_i d\omega_i$
Bidirectional Reflectance Distribution Function (BRDF)Reflection at a Point 光在一个点的反射
可以理解成, ...
GAMES101 14 Ray Tracing 2 Accelerate
14 Ray Tracing 2 AccelerateAcceleration: Bounding Volumes
Ray-Intersection With a Box
Understanding : box is the intersection of 3 pairs of slabs.
Axis-Aligned Bounding Box: AABB 轴对齐包围盒
光线进入所有包围面,进入盒子。出去其中一个包围面,出去包围盒。
$t_{enter}=max{t_{min}}, t_{exit}=min{t_{max}}$
If $t_{enter}<t_{exit}$, ray stay a while in the box.
$t_{enter}<t_{exit} and t_{exit}>=0$, ray and AABB intersection.
Grid Solution: 在bounding box 里面再弄一堆格子
Spatial Partitioning Examples
Oct-Tree
KD-Tree
BSP- ...
GAMES101 13 Ray Tracing 1 Whitted-Style
13 Ray Tracing 1 Whitted-StyleShadow Mapping before we move onTBD
Whitted-Style Ray TracingTBD
Why Ray Tracing?
Rasterization couldn’t handle global effects well
Soft shadow
Light bounces more than once
Ray Tracing is accurate, but is very slow
Rasterization: real-time, ray tracing: offline
~10k CPU core hours to render one frame in production.
Definition:
Light Rays:
Light travels in straight lines 直线传播
Light rays do not collide with each other if they cross 不相互影响
Light rays travel from th ...
GAMES101 12 Geometry 3 Mesh Operation
Geometry 3 Mesh Operationby @SankHyan24
Mesh Subdivision:
Loop Subdivision:(used only on triangle)
Add the number of triangle
Assign new vertex positions according to weight
New/old vertices updated differently
For new vertices: Updated to $\frac{3}{8}(A+B)+\frac{1}{8}(C+D)$
For old vertices: Updated to
$(1-nu)\times original position + u neighbor position sum$
$n: vertex degree$
$u:\frac{3}{16} if n=3, \frac{3}{8n} otherwise $
Catmull-Clark Subdivision (General Mesh)
Definitio ...
GAMES101 11 Geometry 2 Curves and Surface
11 Geometry 2 Curves and Surface 曲线和表面
Explicit Representations
Curves
Bezier Curves
De Casteljau’s Algorithm
B-splines, etc.
Surfaces
Bezier surfaces
Triangles & quads
Subdivision, simplification, regulation
Explicit Representations
Point Cloud (Explicit)
Easiest representation: list of points(x,y,z)
只要点足够密,表示任何面
经常被转化成多边形面
Polygon Mesh (Explicit)
Store vertices & polygons(一般是三角形/四边形)
更复杂的数据结构,更普遍的表达形式
The Wavefront Object File (.obj) Format
Curves
Bezier Curves 贝塞尔曲线
D ...
GAMES101 10 Geometry 1 Introduction
Lecture 10 Geometry 1 Introduction 几何
About how to describe a stuff by geometry.
A string -> fiber->ply->thread
very complex geometry: a city a dog .etc
Not every geometry can be described as triangles.
Many Ways to Represent Geometry
Implicit: 隐式
points satisfy some specified relationship, E.g. sphere:all points in 3D, where $x^2+y^2+z^2=1$
more generally, $f(x,y,z)=0$
Implict Surface: Sampling can be hard, Inside/Outside tests is easy.
Explicit: 显式
All points are gi ...