CS480 - PowerPoint PPT Presentation

1 / 49
About This Presentation
Title:

CS480

Description:

( magnification) A pixel is smaller than one texel. ( minification) Get the nearest texel. ... magnification. 29. minification. 30. 31. mipmapping. To deal with ... – PowerPoint PPT presentation

Number of Views:18
Avg rating:3.0/5.0
Slides: 50
Provided by: vrgr
Category:

less

Transcript and Presenter's Notes

Title: CS480


1
CS480
  • Chap 0. Overview
  • Chap 1. Graphics Systems and Models
  • Chap 2. Graphics Programming
  • Chap 3. Input and Interaction
  • Chap 4. Geometric Objects and Transformations
  • Chap 5. Viewing
  • Chap 6. Shading
  • Chap 7. Implementation
  • Chap 8. Working with Models
  • Chap 9. Discrete Techniques
  • Chap 10. Curves and Surfaces
  • Chap 11. Procedural Methods

2
Chap 9. Discrete Techniques
  • 9-1. Buffers and Mappings
  • 9-2. Texture Mapping
  • 9-3. Environmental Maps
  • 9-4. Bump Maps
  • 9-5. Writes into Buffers
  • 9-6. Bits and Pixel Operations in OpenGL
  • 9-7. Compositing Techniques
  • 9-8. Use of the Accumulation Buffer
  • 9-9. Sampling and Aliasing

3
Graphics Pipeline
Application-specific processing
Pixel processing
Polygon processing
Scene processing
Scene graph
Display list
Frame buffer
Z- buffer
Texture memory
Past - No access to frame buffer Present -
Access is needed for texture mapping,
anti-aliasing, compositing,
alpha-blending.
4
Graphics Pipeline
Application-specific processing
Pixel processing
Polygon processing
Scene processing
Scene graph
Display list
Frame buffer
Depth buffer
Texture memory
(x, y), Z, (R,G,B,A), (T, s,t)
(X, Y, Z), M
5
(No Transcript)
6
(No Transcript)
7
(No Transcript)
8
9-1. Buffers and Mapping
  • So far,
  • frame buffer,
  • depth (z) buffer.
  • More realism
  • not by modeling,
  • but at the scan conversion.

9
  • More realistic rendering
  • during the scan conversion.
  • first, break the surface into small pieces (
    fragments).
  • 1) Texture mapping
  • Color of a fragment is determined by
  • fixed pattern
  • texture-generation algorithm
  • real image
  • 2) bump mapping
  • Surface normal of a fragment is determined by
  • the bump map
  • 3) Environmental (reflection) mapping
  • false ray-tracing

10
(No Transcript)
11
9-2. Texture Mapping
12
(No Transcript)
13
(No Transcript)
14
(No Transcript)
15
  • Texture mapping outline

1
0
parametric modeling
0
1
T(s,t)
texture mapping
projection
1
0
0
1
texel
fragment
pixel
16
  • Consideration 1
  • Concept is simple, but ...
  • 2D (texture map) ---gt 3D (object surface) is
    not easy because ...
  • A pixel defines an area, not a point.

17
  • Consideration 2
  • Texture mapping may produce aliasing effects,
  • especially with the forward mapping.
  • Better do the backward mapping. (screen coord
    ---gt texture coord)

18
  • Mapping methods
  • 1) (s, t) texture map ? P (u, v) target
    surface

19
  • 2) T (s, t) ---gt intermediate surface ---gt P
    (u, v)
  • (cylinder, sphere, box)

20
(No Transcript)
21
(No Transcript)
22
(No Transcript)
23
Texture mapping in OpenGL
24
  • Define a texture map.
  • glTexImage2D (GL_TEXTURE_2D, level, components,
  • width, height,
  • border, format, type, tarray )
  • Enable the texture map
  • glEnable (GL_TEXTURE_2D)
  • Assign texture coordinated to vertices
  • glTexCoord2f (s, t)

25
  • glBegin (GL_QUAD)
  • glTexCoord2f (0.0, 0.0)
  • glVertex2f (x1, y1, z1)
  • glTexCoord2f (1.0, 0.0)
  • glVertex2f (x2, y2, z2)
  • glTexCoord2f (1.0, 1.0)
  • glVertex2f (x3, y3, z3)
  • glTexCoord2f (0.0, 1.0)
  • glVertex2f (x4, y4, z4)
  • glEnd( )

26
(No Transcript)
27
  • aliasing
  • A pixel is larger than one texel. (magnification)
  • A pixel is smaller than one texel. (minification)
  • Get the nearest texel.
  • Compute the average (typically 2 by 2).

28
  • magnification

29
  • minification

30
(No Transcript)
31
  • mipmapping
  • To deal with minification aliasing.
  • gluBuild2DMipmaps (GL_TEXTURE_2D, 3, 64, 64,
  • GL_RGB, GL_UNSIGNED_BYTE,
  • my_texels )

32
  • texture and shading
  • modulation
  • decaling
  • transparency
  • interpolation
  • linear interpolation
  • perspective correction

33
  • Texture generation

34
9-3. Environmental Map
35
(No Transcript)
36
  • mirror effect, reflection on a metal ball
  • basic idea

37
(No Transcript)
38
  • method
  • 1. Set up an imaginary camera.
  • 2. Remove the object.
  • 3. Render the image for the imaginary camera.
  • (This will create an environmental map.)
  • 4. Treat the environmental map as a texture.
  • 5. Perform texture mapping.

39
Jan van Eyck (1390 1441) - ??? ??? (?)
40
(No Transcript)
41
(No Transcript)
42
(No Transcript)
43
9-4. Bump Maps
  • Creating a realistic non-smooth surface
  • (e.g., orange)
  • i) surface modeling
  • ii) texture mapping
  • What if change the light direction?
  • iii) bump mapping
  • Perturb the normal vector.
  • Do not perturb the surface geometry itself.

44
(No Transcript)
45
(No Transcript)
46
(No Transcript)
47
(No Transcript)
48
(No Transcript)
49
(No Transcript)
Write a Comment
User Comments (0)
About PowerShow.com