150 likes | 370 Views
Module 07. Advanced mapping techniques: DOT3 bump mapping. Overview. DOT3 bump mapping Benefits of using DOT3 bump mapping Construction of DOT3 bump mapping. DOT3 bump mapping (1). DOT3 bump mapping uses 'per pixel lighting
E N D
Module 07 Advanced mapping techniques: DOT3 bump mapping
Overview • DOT3 bump mapping • Benefits of using DOT3 bump mapping • Construction of DOT3 bump mapping
DOT3 bump mapping (1) • DOT3 bump mapping uses 'per pixel lighting • The idea behind 'bump mapping' is to avoid that a surface relief requires any geometric detail. • It is much 'cheaper' to apply special 'normal maps' to a triangle, which gives its flat surface a 3-dimensional appearance. • Theoretically a 'normal' is a vector that points into the direction that a surface is facing (orthogonal to its surface) and it is required to compute the direction in which a surface reflects light.
DOT3 bump mapping (2) • Dot product bump mapping uses a map that applies 'false' normals to each pixel of a triangle, so that the reflection is not computed in accordance to the 'real' flat triangle surface, but according to the surface vectors of the normal map. • This results in the bump mapping effect, giving the surface a 3D-appearance that is not 'really' geometrically there.
Benefits of using DOT3 bump mapping (1) • DOT3 bump mapping is the best bump mapping technique so far. • The difference between "real" bump mapping and dot3 bump mapping is instead of penetrating the surface normal and binormal at each rendered pixel of a surface in dot3 bump mapping a normal map is used. • A normal map is similar to the usual texture map but instead containing color values (as RGB) it contains normal values (as xyz). This map is placed on the surface. • You can calculate a normal map from a luminance (gray value) picture by simply treading each pixel in the picture as a vertex of a triangle.
Benefits of using DOT3 bump mapping (2) • Each time a triangle of the bump mapped object is moved or rotated the normals of the normal map need to be transformed again, because their direction changed in relation to the light source or the view port. • The GPU’s Vertex Shader is able to compute the vectors required for the transform of the normal maps, using the so-called 'texture space'. This procedure is also called 'per-vertex dot3-setup'.
Construction of DOT3 bump mapping (1) Default texturing
Construction of DOT3 bump mapping (2) Diffuse lighting - Normal map
Construction of DOT3 bump mapping (3) Diffuse lighting – per pixel lighting without texture
Construction of DOT3 bump mapping (4) Diffuse lighting – per pixel lighting with texture
Construction of DOT3 bump mapping (5) Diffuse lighting and Ambient lighting
Construction of DOT3 bump mapping (6) Specular lighting
Construction of DOT3 bump mapping (7) Diffuse lighting & Ambient lighting & Specular lighting
Practice Open: Lab07 / DOT3_BumpMapping / DOT3_BumpMapping.sln