Upload
others
View
21
Download
0
Embed Size (px)
Citation preview
Texture Mapping
Fall 2012
(Slides mostly based on those of Voicu Popescu) Daniel G. Aliaga
Department of Computer Science Purdue University
2
Texture mapping
• Model surface-detail with images
– wrap object with photograph(s)
– graphics object itself is a simpler model but “looks” more complex
3
Texture mapping
• Model surface-detail with images
– wrap object with photograph(s)
– graphics object itself is a simpler model but “looks” more complex
4
Texture mapping
• Generic image to represent material
– e.g., tile pattern
bark
veneer
bricks
5
Tiling
• Repeat pattern
6
Tiling
• Repeat pattern
7
Tiling
• Repeat pattern
• How can we improve?
8
Tiling
• Repeat pattern
– reduce seems by mirroring
9
Tiling
• Repeat pattern
– reduce seems by mirroring
10
Tiling
• Repeat pattern
– reduce seems by mirroring
11
Tiling
• Repeat pattern
– reduce seems by mirroring
– How we can further improve?
12
Tiling
• Repeat pattern
– reduce seems by mirroring
– reduce seems by choosing tile that covers one period of repeated texture
13
Tiling
14
Texture mapping limitations do exist…
15
Bricks are similar not identical
16
Solution?
17
Solution: Texture synthesis…
18
Texture coordinates
• Mechanism for attaching the texture map to the surface modeled
– a pair of floats (s, t) for each triangle vertex
– corners of the image are (0, 0), (0, 1), (1, 1), and (1, 0)
– tiling indicated with tex. coords. > 1
– texels – color samples in texture maps
19
x
y
z
O
P2(0, 0)
P1(1, 0)
P4(1, 1)
P3(0, 1)
Texture coordinates
20
Texture mapping
C
c
a
b
P1’
P2(0, 0)
P2’
P3’
P1(1, 0)
P4(1, 1)
P3(0, 1)
x
y
z
O
21
Texels: texture elements
P1’(u1, v1, s1, t1)
P2’(u2, v2, s2, t2) P3’(u3, v3, s3, t3)
P’(u, v, s, t)
22
Texture mapping
C
c
a
b
P1’
P2(s2, t2)
P2’
P3’
P1(s1, t1)
P3(s3, t3)
P (s, t)
P’
x
y
z
O
Problem: how to
compute the texture
coordinates for an
interior pixel?
23
Texture mapping
C
c
a
b
P1’
P2(s2, t2)
P2’
P3’
P1(s1, t1)
P3(s3, t3)
P (s, t)
P’
x
y
z
O
Solution: interpolate
vertex texture coordinates
Parameter Interpolation
• Texture coordinates, colors, normals, etc.
25
Level of detail problem
aliasing anti-aliased
If curious, you can read more on this subject!