GAMES101 09 Texture Mapping
Texture Mapping 纹理映射Interpolation Across Triangles: Barycentric Coordinates 重心坐标
A coordinate system for triangles ( $\alpha ,\beta ,\gamma$ )
$(x,y)=\alpha A+\beta B+\gamma C, where \alpha ,\beta ,\gamma>0 and \alpha ,\beta ,\gamma+1=0$
How to Calculate them? Use the triangle area: $$ \alpha = \frac{A_A}{A_A+A_B+A_C}, \ \beta = \frac{A_B}{A_A+A_B+A_C}, \ \gamma = \frac{A_C}{A_A+A_B+A_C} $$
重心坐标不具有投影变换不变性,所以先三维插值,再投影到二维面上去
Texture Magnification: What if the textu ...
GAMES101 08 SHADING 2
08 Shading 着色Blinn-Phong Reflection Model
Specular highlights Term 高光
Intensity depends on view direction
Bright near mirror reflection direction
V close to mirror direction <–> half vector near normal(h)
Measure “near” by dot productof unit vectors
Formula: $L_s = k_s(I/r^2)max(0,<n,h>)^p$
What is the p in $max(0,<n,h>)^p$ for? Make it real:
If $\alpha $ is too big, $<n,h>^p$ is small.
Ambient Term 环境光照
Assumption: Shading that does not depend on any ...
GAMES101 07 SHADING
07 Shading 着色解决遮挡(Visibility)与着色的问题———Z-bufferingBlinn-Phong Reflection Model现在只针对于一个点的着色1.Painter’s Algorithm
遮挡和覆盖overwrite
但是对于物体,填充顺序是个问题
nlog(n)
2.Z-Buffer 深度缓存,n triangle
idea :存储min.z-value, for every pixel
Frame buffer
Depth buffer
Algorithm 维护当前看到的最浅深度的信息
initialize depth buffer to infinity
zbuffer[x,y] denotes the screen’s pixel buffer
framebuffer[x,y] denotes the information(r,g,b) of the pixel
for(every triangle)
for(every sample(x,y,z)in Triangle)
if(z<zbuffer[x,y])
framebuffe ...
GAMES101 06 MSAA
反走样(应对取样带来的模糊)空间上走样
锯齿
摩尔纹时间上走样
车轮效应
方法:先模糊,再采样傅里叶变换边界:高频率波
Low Pass filter 低通滤波,模糊
High Pass filter 高通滤波,留下边界
Filter out low and high frequency 保留中间信号
Filter = Convolution = AverageConvolution:
用Filter(卷积核)对signal一个点的周围区域进行加权平均,生成一个新的信号(一般都变小了)
卷积定理:直接卷积(时域上),和先傅里叶变换(变到频域上)再与卷积核傅里叶变换的结果进行乘积再逆傅里叶变换回去,结果是一样的。
采样,频域上就是复制波,采样约密集,复制出来的波差的越远
高频信号的频谱更长,采样之后更容易覆盖
抗锯齿处理:
增加采样率
模糊化,本质上砍掉高频信息,让频谱覆盖面小一些
实际运用:
MSAA抗锯齿: 几个像素模糊化
代价:更大的计算量
其他应用:
FXAA:图像层面抗锯齿,找边界抗锯齿
TAA: Temporal AA 与时间相关,时间上复用 ...
GAMES101 1~5
不是很难,所以没怎么记,就当个目录放这里吧
1 Overview of Computer Graphics2 Review of Linear Algebra3 Transformation4 Transformation Cont5 Raterization 1 Triangles