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 texture is too small?)
- A pixel on a texture — a texel (纹理元素、纹素)
- Solution:
- Bilinear Interpolation:
双线性插值 Use the nearest 4 point to interpolation
Actually use 3 interpolations, Horizontal twice and vertical once. - Bicubic Interpolation …
- Bilinear Interpolation:
- Texture Magnification (hard case) (What if the texture is too large?)
- Antialiasing – Supersampling
- MSAA: Yes, but costly.
- Signal frequency too large in a pixel.
- So what if we don’t sample– Just need to get the average value within a range.
- Point Query vs. Range Query
- Mipmap, a serial of image of texture.(128x128)
- level 0 is the texture it self.
- level x is the $\frac{1}{4^x}$ size of the level 0
- all of the mipmap just cost more $\frac{1}{3}$ space
- Computing Mipmap level D
- Reflect pixel and its neighbor to the textrue, and choose half of them.
- Get the map of the texture, change the pixel reflection to the square area (use the max deritative).
- D rounded to the nearest integer level: bad
- How to solve when D=0.8? Bilinear result between level
- Mipmap trilinear sampling~
- But it is overblur…
- Anisotropic Filtering 各向异性过滤
RipMap, 3 times size of the former texture space - EWA Filter 椭圆加权平均滤波
- Antialiasing – Supersampling
- Texture Application
- Enviroment Map—反光
- Enviroment Lighting
- Use a pheir/cubic to reflect the enviroment light
- Texture can not only present the color, but also the Relative height
- Bump mapping 凹凸贴图 给像素增加法线扰动
- 如何求法线 用微分求切线,两个方向切线, $n=(-dP/du,-dP/dv,1).normolization()$,注意求的是原坐标系的法线
- Displacement mapping 位移贴图 真的移动了顶点位置,需要模型本身足够细,比纹理密度还要高(Direct X 不需要,有动态细分的功能)
- Bump mapping 凹凸贴图 给像素增加法线扰动
- 3D Texture 应用噪声生成三维模型的纹理(大理石)
- Ambient Occlusion 环境光遮蔽,用纹理记录环境光的信息
- 3D Textures and Volume Rendering 立体渲染
- Enviroment Map—反光
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 Chuan 川 Charles!
评论