CS248 Final Review - PowerPoint PPT Presentation

About This Presentation
Title:

CS248 Final Review

Description:

for each pixel, cast a ray into the scene, and use the color of the point on the ... Lspec = Ks x cosn(a), a= angle between viewer and reflected ray ... – PowerPoint PPT presentation

Number of Views:24
Avg rating:3.0/5.0
Slides: 33
Provided by: szymo5
Category:
Tags: cs248 | final | ray | review

less

Transcript and Presenter's Notes

Title: CS248 Final Review


1
CS248 Final Review
2
CS248 Final
  • Thurs, December 12, 7-10 pm, Gates B01, B03
  • Mainly from material in the second half of the
    quarter
  • will not include material from last part of last
    lecture (volume rendering, image-based rendering)
  • Review session slides available from class
    website
  • Office hours as regularly scheduled

3
CS248 Final Review Contents
  • Image warping, texture mapping
  • Perspective
  • Visibility
  • Lighting / Shading

4
Texture Mapping
  • Coordinate systems
  • u,v,q gt xo, yo zo, wo gt xw, yw zw, ww gt
    x, y, w
  • Assuming all transforms are linear, then
  • Au, v, q x, y, w
  • Common mappings
  • forward mapping (scatter), texture-gtscreen
  • backward mapping (gather)

5
Texture Warps
  • Rotation, translation
  • perspective
  • Minification (decimation)
  • unweighted average average projected texel
    elements that fall within a pixels filter
    support
  • area-weighted average average based on area of
    texel support

6
Texture Warps
  • Magnification
  • Unweighted
  • Area-weighted
  • bilinear interpolation

texel
pixel
7
Textures
  1. Mipmapping
  2. multi-resolution texture
  3. bilinear interpolation at 2 closest resolutions
    to get 2 color values
  4. linear interpolate 2 color values based on actual
    resolution
  5. Summed area tables
  6. fast calculation of prefilter integral in texture
    space

8
Viewing Planar Projections
  • Perspective Projection
  • rays pass through center of projection
  • parallel lines intersect at vanishing points
  • Parallel Projection
  • center of projection is at infinity
  • oblique
  • orthographic

How many vanishing points are there in an image
produced by parallel projection ?
9
Specifying Perspective Views
  • Observer position (eye, center of projection)
  • Viewing direction (normal to picture plane)
  • Clipping planes (near, far, top, bottom, left,
    right)

10
Viewing OpenGL Pipeline
  • Object Space
  • Eye Coordinates
  • Projection Matrix
  • Clipped to Frustum
  • Homogenize to normalized device coordinates
  • Window coordinates

11
Visibility
  1. 6 visible-surface determination algorithms
  2. Z-buffer
  3. Watkins
  4. Warnock
  5. Weiler-Atherton
  6. BSP Tree
  7. Ray Tracing

12
Things to know
  • how does it work
  • what are the necessary preconditions?
  • asymptotic time complexity
  • how can anti-aliasing be done?
  • how can shading be incorporated?
  • well-suited for hardware?
  • parallelizable?
  • ease of implementation
  • best-case/worst-case scenarios

13
Z-buffer
  • Project all polygons to the image plane, at each
    pixel, pick the color corresponding to closet
    polygon

14
Watkins
  • Scanline depth
  • progressing across scanline, if pixel is inside
    two or more polygons, use depth to pick
  • process interpenetrating polygons, add those
    events

15
Warnock Subdivision
  • Start with area as original image
  • subdivide areas until either
  • all surfaces are our outside the area
  • only one inside, overlapping or surrounding
  • a surrounding surface obscures all other surfaces


16
Weiler-Atherton Subdivision
  • Cookie-cutter algorithmclips polygons against
    polygons
  • front to back sort of list
  • clip with front polygon

17
BSP Trees
  • Provides a data structure for back-to-front or
    front-to-back traversal
  • split polygons according to specified planes
  • create a tree where edges are front/back, leaves
    are polygons

18
Ray Tracing
  • Ray Casting
  • for each pixel, cast a ray into the scene, and
    use the color of the point on the closest polygon
  • Parametric form of a line u(t) a(b-a)t

a
t
y
b
(0,0)
x
19
Ray Tracing
  • Sphere P-Pc2 r2 0
  • Plane N P -D
  • Can you compute the intersection of a ray and a
    plane? A ray and a sphere?

20
Ray Tracing
  • Point in polygon tests
  • Odd, even rule
  • draw a line from point to infinity in one
    direction
  • count intersections odd inside, even outside
  • Non-zero winding rule
  • counts number of times polygon edges wind around
    a point in the clockwise direction
  • winding number non zero inside, else outside

21
Lighting
  • Terminology
  • Radiant flux energy/time (joules/sec watts)
  • Irradiance amount of incident radiant flux /
    area (how much light energy hitting a unit area,
    per unit time)
  • Radiant intensity (of point source) radiant flux
    over solid angle
  • Radiance radiant intensity over a unit area

22
Lighting
  • Point to area transport
  • Computing the irradiance to a surface
  • Cos falloff N L
  • E Fatt x I x (N L)

23
Lighting
  • Lambertian (diffuse) surfaces
  • Radiant intensity has cosine fall off with
    respect to angle
  • Radiance is constant with respect toangle
  • Reason the projected unit area ALSO gets smaller
    as a cosine fall off!
  • Fatt x I x Kd x (N L)

N
N
V
I ? length cos(t)
V
Radiance intensity intensity/solid angle
24
Lighting
  • BRDF Bidirectional Reflectance Distribution
    Function
  • description of how the surface interacts with
    incident light and emits reflected light
  • Isotropic
  • Independent of absolute incident and reflected
    angles
  • Anisotropic
  • Absolute angles matter
  • Dont forget the generalizations to the BRDF!
  • Spatially/spectrally varying, florescence,
    phosphorescence, etc.

25
Lighting
  • Phong specular model
  • Isnt true to the physics, but works pretty well
  • reflected light is greatest near the reflection
    angle of the incident light, and falls off with a
    cosine power
  • Lspec Ks x cosn(a), a angle between viewer
    and reflected ray
  • how do you compute the reflected ray vector?

N
L
R
V
26
Lighting
  • Local vs. infinite lights
  • Understand them! Know how to draw the goniometric
    diagrams for various light/viewer combinations
  • N H model
  • H is the halfway vector between the viewer and
    the light
  • What is the difference in specular highlight?

N
H
L
R
V
27
Shading
  • Gouraud shading
  • Compute lighting information (ie colors) at
    polygon vertices, interpolate those colors
  • Problems?
  • Misses highlights
  • need high resolution mesh to catch highlights
  • mach bands!

28
Shading
  • Angle interpolation
  • interpolate normal angles according to the
    implicit surface
  • compute shading at each point of the implicit
    surface
  • CORRECT! But very expensive

29
Shading
  • Phong shading
  • Compute lighting normals at all points on the
    polygon via interpolation, and do the lighting
    computation on the interpolated normals (of the
    polygon)
  • Problems? Difference with angle interpolation?

N2
N1
Implicit surface
Polygon approximation
30
Lighting and Shading
  • Know the OpenGL 1.1, 1.2 light equations

31
Exotic uses of textures
  • Environment/reflection mapping
  • Alphas for selecting between textures/shading
    parameters
  • Bump mapping
  • Displacement mapping
  • Object placement
  • 3d textures

32
Good Luck!
Good Luck on the Final! ?
More review questions at http//graphics.stanford
.edu/courses/cs248-99/final_review
Write a Comment
User Comments (0)
About PowerShow.com