Lesson 7 – Textures PV227 – GPU Rendering Jiˇrí Chmelík, Jan ˇCejka Fakulta informatiky Masarykovy univerzity 10. 11. 2015 PV227 – GPU Rendering (FI MUNI) Lesson 7 – Textures 10. 11. 2015 1 / 11 Textures Lots of usages... diffuse texture, dissolve effect, cube map, normal map, . . . PV227 – GPU Rendering (FI MUNI) Lesson 7 – Textures 10. 11. 2015 2 / 11 Diffuse Texture texture for object apperance, used to modulate the computed light, should not be used for specular component. Figure: Texture modulating ambient + diffuse color. PV227 – GPU Rendering (FI MUNI) Lesson 7 – Textures 10. 11. 2015 3 / 11 Dissolve Effect discard some of the fragments based on the texture value, animation through changing the threshold. Figure: Dissolve effect with t=0.5f. PV227 – GPU Rendering (FI MUNI) Lesson 7 – Textures 10. 11. 2015 4 / 11 Cube Map six textures mapped to sides of a cube, accessed with a vector from the center of the cube in world space. Figure: Various methods of computing cube map vector. PV227 – GPU Rendering (FI MUNI) Lesson 7 – Textures 10. 11. 2015 5 / 11 Cube Map Indexing any access vector can be computed, can be used as regular texture, can be used to “follow” a modified light path. Figure: D3D perspective. Taken from gpwiki.org PV227 – GPU Rendering (FI MUNI) Lesson 7 – Textures 10. 11. 2015 6 / 11 Normal Map modify the normal for lighting to increase details, the normal map may be position dependent / independent. Figure: Various methods of using the normal map. PV227 – GPU Rendering (FI MUNI) Lesson 7 – Textures 10. 11. 2015 7 / 11 Normal Map Types vector is stored per texel (only height for bump map), Object/World normal map, stores normals in object/world space, predominantly green / yellow / red, usefull only for fixed objects, Tangent normal map, stores normals in tangent space, predominantly blue, any object, any position / rotation. PV227 – GPU Rendering (FI MUNI) Lesson 7 – Textures 10. 11. 2015 8 / 11 Normal Map Examples Figure: Taken from crydev.net PV227 – GPU Rendering (FI MUNI) Lesson 7 – Textures 10. 11. 2015 9 / 11 Tangent Normal Map computations take place in tangent space, light and eye must be transformed to this space, conversion by a transform matrix, n, t, b are in camera space.    t.x t.y t.z b.x x.y b.z n.x n.y n.z    PV227 – GPU Rendering (FI MUNI) Lesson 7 – Textures 10. 11. 2015 10 / 11 Tangent Space Figure: Taken from txutxi.com PV227 – GPU Rendering (FI MUNI) Lesson 7 – Textures 10. 11. 2015 11 / 11