PV227 GPU programming Marek Vinkler Department of Computer Graphics and Design PV227 GPU programming 1 / 10 Textures texture images, diffuse texture, dissolve effect, cube map, normal map. PV227 GPU programming 2 / 10 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 programming 3 / 10 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 programming 4 / 10 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 programming 5 / 10 Cube map 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 programming 6 / 10 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 programming 7 / 10 Normal map 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 programming 8 / 10 Normal map Figure: Taken from crydev.net PV227 GPU programming 9 / 10 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 programming 10 / 10