Texture Mapping

本章节就计算机视觉的纹理映射做了介绍,是指纹理空间中的纹理像素映射到屏幕空间中的像素的过程,介绍了诸如柱体纹理映射,球体纹理映射等等,此外介绍了纹理地图集的概念,怎么经过过滤取样,以及如何进行缩小过滤等。
展开查看详情

1.Texture Mapping CMSC435 UMBC *With lots of borrowing from the usual victims…

2. Motivation Flat and Boring “Textured”

3. Texture Mapping • Definition: mapping a function onto a surface; function can be: – 1, 2, or 3D – sampled (image) or mathematical function 3

4. Texture Mapping “Texture” Boring Geometry Texture  An image that’s mapped onto something Texel  Texture pixel (Also, an island in Denmark…)

5.Texture Mapping Interesting Geometry

6. Texture Mapping Mapping Function 2D Texture 3D Coordinate Coordinate Texture Image

7. Texture Coordinates u • Normalized 2D space – 0-1 on each axis v D3D • Letters vary: – U,V are most common – GL/RMan specs like s,t Texture Coordinates as RGB • Typically periodic t OGL s

8. Texture Tiling 0,0 0,0 0,1 0,2 1,0 2,0 Scale UV Coordinates  Alter texture frequency 0,0 0,0 0,4 0,8 4,0 8,0

9. Planar Mapping • For xy aligned plane • Reverse projection 9

10.Planar Mapping 10

11. Cylindrical Mapping • For cylinder with point – • Texture coordinates – 11

12.Cylindrical Mapping 12

13. Spherical Mapping • For sphere with point – • Texture coordinates 13

14.Spherical Mapping 14

15.Mapping onto Parametric Patches • Use scaled surface u,v parameters for texture u,v 15

16.Mapping onto Parametric Patches 16

17.Mapping onto Polygons Explicit per-vertex coordinates… Wikipedia

18. Texture Atlas • Properties of good UV layout: – Minimizes stretch – Maximize packing efficiency – Easy for artist to paint into • Unlike that one… – Automatic is possible, but manual often Zhou et al. preferred

19. Texture Atlas • Not always a 1:1 mapping

20. Texture Seams • Discontinuity at UV chart boundaries • Solutions: – Fix them: • Copy/Blend texels across boundary – Hide them • Armpits, ankles, backs of heads, under clothing Peter Kojesta (Gamasutra)

21. Environment Mapping • Surround scene with maps simulating surrounding detail 21

22. Distant Reflection • Look up reflection direction in reflection or environment map 22

23. Cubic Environment Maps • Pick a face based on largest normal component • Project onto the face – Divide through • Use resulting coordinates for 2D lookup

24. Spherical Environment Maps • Photograph of shiny sphere – Lookup based on x/y coordinates of normal DirectX Documentation

25. Texture All the Things • Texture/Albedo map (Catmull 74) • Reflection Map (Blinn and Newell 76) • Bump/Normal Map (Blinn 78 / Cohen 98) • Gloss Map (Blinn 78) • Transparency Map (Gardner 85) • Diffuse Reflectance (Miller and Hoffman 84) • Shadows, displacements, etc (Cook 84) • Tangent map (Kajiya 85) 25

26. Texture Sampling • Point Sampling – Map UV coordinate onto texel grid, grab corresponding texel • i = floor(u*width) • j = floor(v*height) – Just like in 1995

27.Point Sampling Point sampling under magnification

28. Filtered Sampling • Bilinear Filtering – Interpolate texels in 2x2 neighborhood • Top-left texel: – floor(u*(width-1)), floor(v*(height-1)) • Weight by fractional coordinates

29.Point Sampling Point sampling under magnification