games101-week5

Shading

Barycentric Coordinates

为了在三角形内部进行插值

Simple Texture Mapping

Texture Magnification

采样后的图片很大,但是纹理很小。多个 pixel 用一个 texel

Bilinear Interpolation

Texture is too large

超采样可以解决,但是耗时

实际上有个算法 Range Query,给一个纹理然后快速给出一个区域的平均

得到纹理之后就计算出下面的

要保证查到的值连续,又需要插值(三线性插值)

Anisotropic Filtering

Mipmap 只能处理正方形的,就会出现问题

Mipmap 只能生成对角线上的图

Anisotropic Filtering 正方形映射到矩形,但是处理不规则的还是存在问题

针对不规则的形状

环境光

纹理 = 内存 + 范围查询

环境光作为纹理存储,但是对球来说会发生扭曲(想象地球仪)

Textures can affect shading!

Bump Mapping

Geometry

"Implicit" Representations of Geometry

不描述点,而描述点满足的表达式

"Explicit" Representations of Geometry

映射,把点画出来就找到了

Implicit 表示实例

Explicit 表示实例