Download presentation
Presentation is loading. Please wait.
1
Texture Mapping Jung Lee
2
*Edwin Catmull, Ph.D. Thesis, 1974
Texture Mapping* Adds visual detail to surfaces of 3D objects
3
Texture Mapping Example
4
Texture and Texel Texel : Texture Element Texture Coordinates (s, t)
GPUs can handle usually 2m x 2n texels Where m and n are nonnegative integers Texture Coordinates (s, t)
5
2D Texture Space Continuous (s, t) Coordinate Space [0, 1]
For mapping it into a discrete texture image space [Texture Map] [2D Texture Image]
6
Texture Mapping Overview
1. Define a texture image 2. Specify mapping from the texture to surface Texture coordinate 3. Lookup texture values during scan conversion (0, 1) (1, 0) t v s u (0, 0) y x
7
Texture Value Lookup Bilinearly interpolate texture coordinates
In the scan conversion step α β (u1, v1) (u3, v3) (u2, v2)
8
Texture Modulation Texture Shaded Color Texture Shading
9
Bump Mapping Perturbs surface normal vectors Normal Information
So called ‘normal mapping’ Normal Information Normal information can be stored in a RGB image Convert (x, y, z) to (R, G, B)
10
Bump Mapping Example (1/5)
[Bump Mapped Sphere]
11
Bump Mapping Example (2/5)
12
Bump Mapping Example (3/5)
13
Bump Mapping Example (4/5)
14
Bump Mapping Example (5/5)
4M Triangles 500 Triangles
15
Displacement Mapping Modifying the actual surface geometry
16
How to Assign Normal Vectors in OpenGL
Face Normal Vector Vertex Normal Vector N(a, b, c) glBegin(GL_POLYGON); glNormal3f(a, b, c); glVertex3f(x1, y1, z1); glVertex3f(x2, y2, z2); glVertex3f(x3, y3, z3); glEnd(); P1(x1, y1, z1) P2(x2, y2, z2) P3(x3, y3, z3) N1(a1, b1, c1) glBegin(GL_POLYGON); glNormal3f(a1, b1, c1); glVertex3f(x1, y1, z1); glNormal3f(a2, b2, c2); glVertex3f(x2, y2, z2); glNormal3f(a3, b3, c3); glVertex3f(x3, y3, z3); glEnd(); N2(a2, b2, c2) P1(x1, y1, z1) N3(a3, b3, c3) P2(x2, y2, z2) P3(x3, y3, z3)
17
Environment Mapping Maps a surrounding environment texture
Around a surface of an object To approximate effects like reflection or refraction View dependant Due to reflective mapping process Not need the texture coordinates Since surface normals are used to map the environment texture Cubic Environment Mapping Spherical Environment Mapping
18
Cubic Environment Mapping
19
Environment Mapping Example
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.