+ All Categories
Home > Documents > PPT+-+Computer+Graphics+at+Stanford+University

PPT+-+Computer+Graphics+at+Stanford+University

Date post: 09-Apr-2018
Category:
Upload: atiullah-khan
View: 213 times
Download: 0 times
Share this document with a friend

of 32

Transcript
  • 8/7/2019 PPT+-+Computer+Graphics+at+Stanford+University

    1/32

    CS248 Final Review CS248 Final Review

  • 8/7/2019 PPT+-+Computer+Graphics+at+Stanford+University

    2/32

    CS248 FinalCS248 Final

    Thurs, December 12, 7-10 pm, GatesB01, B03

    Mainly from material in the second half of the quarter will not include material from last part of last

    lecture (volume rendering, image-basedrendering)

    Review session slides available fromclass website

    Office hours as regularly scheduled

  • 8/7/2019 PPT+-+Computer+Graphics+at+Stanford+University

    3/32

    CS248 Final Review ContentsCS248 Final Review Contents

    Image warping, texture mappingPerspectiveVisibilityLighting / Shading

  • 8/7/2019 PPT+-+Computer+Graphics+at+Stanford+University

    4/32

    T exture Mapping T exture Mapping

    Coordinate systems [u,v,q] => [x o, y o zo, wo] => [x w, y w zw, w w]

    => [x, y, w] Assuming all transforms are linear, then

    [A][u, v, q] = [x, y, w]

    Common mappings forward mapping (scatter), texture->screen backward mapping (gather)

  • 8/7/2019 PPT+-+Computer+Graphics+at+Stanford+University

    5/32

    T exture Warps T exture Warps

    Rotation, translationperspectiveMinification (decimation) unweighted average: average projected

    texel elements that fall within a pixels filter

    support area-weighted average: average based on

    area of texel support

  • 8/7/2019 PPT+-+Computer+Graphics+at+Stanford+University

    6/32

    T exture Warps T exture Warps

    Magnification Unweighted Area-weighted bilinear interpolation

    = texel= pixel

  • 8/7/2019 PPT+-+Computer+Graphics+at+Stanford+University

    7/32

    T extures T extures

    1. Mipmapping1. multi-resolution texture2. bilinear interpolation at 2 closest

    resolutions to get 2 color values3. linear interpolate 2 color values based on

    actual resolution

    2. Summed area tables1. fast calculation of prefilter integral in

    texture space

  • 8/7/2019 PPT+-+Computer+Graphics+at+Stanford+University

    8/32

    V iewing: Planar Projections V iewing: Planar Projections

    Perspective Projection rays pass through center of projection

    parallel lines intersect at vanishing pointsParallel Projection center of projection is at infinity

    oblique orthographic

    How many vanishing points are there in an image

    produced by parallel projection ?

  • 8/7/2019 PPT+-+Computer+Graphics+at+Stanford+University

    9/32

    Specifying Perspective V iewsSpecifying Perspective V iews

    Observer position (eye, center of projection)Viewing direction (normal to picture plane)

    Clipping planes (near, far, top, bottom, left,right)

  • 8/7/2019 PPT+-+Computer+Graphics+at+Stanford+University

    10/32

    V iewing: OpenGL Pipeline V iewing: OpenGL Pipeline

    Object SpaceEye Coordinates

    Projection MatrixClipped to FrustumHomogenize to normalized devicecoordinatesWindow coordinates

  • 8/7/2019 PPT+-+Computer+Graphics+at+Stanford+University

    11/32

    V isibility V isibility

    1. 6 visible-surface determinationalgorithms:

    1. Z-buffer 2. Watkins3. Warnock

    4. Weiler-Atherton5. BSP Tree6. Ray Tracing

  • 8/7/2019 PPT+-+Computer+Graphics+at+Stanford+University

    12/32

    Th ings to know Th ings to know

    how does it workwhat are the necessary preconditions?

    asymptotic time complexityhow can anti-aliasing be done?how can shading be incorporated?well-suited for hardware?

    parallelizable?ease of implementationbest-case/worst-case scenarios

  • 8/7/2019 PPT+-+Computer+Graphics+at+Stanford+University

    13/32

    ZZ--bufferbuffer

    Project all polygons to the image plane,at each pixel, pick the color

    corresponding to closet polygon

  • 8/7/2019 PPT+-+Computer+Graphics+at+Stanford+University

    14/32

    Watkins Watkins

    Scanline + depth progressing across scanline, if pixel is

    inside two or more polygons, use depth topick

    process interpenetrating polygons, addthose events

  • 8/7/2019 PPT+-+Computer+Graphics+at+Stanford+University

    15/32

    Warnock Subdivision Warnock Subdivision

    Start with area as original image subdivide areas until either:

    all surfaces are our outside the areaonly one inside, overlapping or surroundinga surrounding surface obscures all other surfaces

    *

  • 8/7/2019 PPT+-+Computer+Graphics+at+Stanford+University

    16/32

    Weiler Weiler --A th erton Subdivision A th erton Subdivision

    Cookie-cutter algorithm:clips polygonsagainst polygons

    front to back sort of list clip with front polygon

  • 8/7/2019 PPT+-+Computer+Graphics+at+Stanford+University

    17/32

    B SP T reesB SP T rees

    Provides a data structure for back-to-front or front-to-back traversal

    split polygons according to specifiedplanes

    create a tree where edges are front/back,leaves are polygons

  • 8/7/2019 PPT+-+Computer+Graphics+at+Stanford+University

    18/32

    Ray T racing Ray T racing

    Ray Casting for each pixel, cast a ray into the scene,

    and use the color of the point on theclosest polygon

    Parametric form of a line: u(t) = a+(b-a)t

    a b

    (0,0) x

    y t

  • 8/7/2019 PPT+-+Computer+Graphics+at+Stanford+University

    19/32

    Ray T racing Ray T racing

    Sphere: | P -P c|2 r 2 = 0Plane: N P = -DCan you compute the intersection of aray and a plane? A ray and a sphere?

  • 8/7/2019 PPT+-+Computer+Graphics+at+Stanford+University

    20/32

    Ray T racing Ray T racing

    Point in polygon tests Odd, even rule

    draw a line from point to infinity in one directioncount intersections: odd = inside, even =outside

    Non-zero winding rulecounts number of times polygon edges windaround a point in the clockwise directionwinding number non zero = inside, else outside

  • 8/7/2019 PPT+-+Computer+Graphics+at+Stanford+University

    21/32

    Lig h ting Lig h ting

    Terminology Radiant flux: energy/time (joules/sec =

    watts) Irradiance: amount of incident radiant flux /

    area (how much light energy hitting a unitarea, per unit time)

    Radiant intensity (of point source): radiantflux over solid angle

    Radiance: radiant intensity over a unit area

  • 8/7/2019 PPT+-+Computer+Graphics+at+Stanford+University

    22/32

    Lig h ting Lig h ting

    Point to area transport Computing the irradiance to a surface

    Cos falloff: N L E = F att x I x (N L)

  • 8/7/2019 PPT+-+Computer+Graphics+at+Stanford+University

    23/32

    Lig h ting Lig h ting

    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! F att x I x K d x (N L)

    NV

    I w length = cos(t)

    Radiance intensity: intensity/solid angle

    NV

  • 8/7/2019 PPT+-+Computer+Graphics+at+Stanford+University

    24/32

    Lig h ting Lig h ting

    BRDF = Bidirectional Reflectance DistributionFunction

    description of how the surface interacts withincident light and emits reflected light Isotropic

    Independent of absolute incident and reflected angles

    AnisotropicAbsolute angles matter

    Dont forget the generalizations to the BRDF!Spatially/spectrally varying, florescence,phosphorescence, etc.

  • 8/7/2019 PPT+-+Computer+Graphics+at+Stanford+University

    25/32

    Lig h ting Lig h ting

    Phong specular model Isnt true to the physics, but works pretty

    well reflected light is greatest near thereflection angle of the incident light, andfalls off with a cosine power

    Lspec = K s x cosn

    (a), a= angle betweenviewer and reflected ray how do you compute the reflected ray

    vector?

    N LR

    V

  • 8/7/2019 PPT+-+Computer+Graphics+at+Stanford+University

    26/32

    Lig h ting Lig h ting

    Local vs. infinite lights Understand them! Know how to draw the

    goniometric diagrams for variouslight/viewer combinations

    N H model

    H is the halfway vector between the viewer and the light

    What is the difference in specular highlight?

    N

    V

    R H L

  • 8/7/2019 PPT+-+Computer+Graphics+at+Stanford+University

    27/32

    Sh ading Sh ading

    Gouraud shading Compute lighting information (ie: colors) at

    polygon vertices, interpolate those colors Problems?

    Misses highlightsneed high resolution mesh to catch highlightsmach bands!

  • 8/7/2019 PPT+-+Computer+Graphics+at+Stanford+University

    28/32

    Sh ading Sh ading

    Angle interpolation interpolate normal angles according to the implicit

    surface compute shading at each point of the implicit

    surface CORRECT! But very expensive

  • 8/7/2019 PPT+-+Computer+Graphics+at+Stanford+University

    29/32

    Sh ading Sh ading

    Phong shading Compute lighting normals at all points on the

    polygon via interpolation, and do the lightingcomputation on the interpolated normals (of thepolygon)

    Problems? Difference with angle interpolation?

    Implicit surfacePolygon approximationN1 N2

  • 8/7/2019 PPT+-+Computer+Graphics+at+Stanford+University

    30/32

    Lig h ting and S h ading Lig h ting and S h ading

    Know the OpenGL 1.1, 1.2 lightequations

  • 8/7/2019 PPT+-+Computer+Graphics+at+Stanford+University

    31/32

    E xotic uses of texturesE xotic uses of textures

    Environment/reflection mapping Alphas for selecting betweentextures/shading parametersBump mappingDisplacement mapping

    Object placement3d textures

  • 8/7/2019 PPT+-+Computer+Graphics+at+Stanford+University

    32/32

    Good Luck!Good Luck!

    Good Luck on the Final!

    More review questions at:http://graphics.stanford.edu/courses/cs248-99/final_review


Recommended