cs248 final review. cs248 final monday, december 6, 3:30 to 6:30 pm, gates b01 closed book, closed...
Post on 20-Dec-2015
216 views
TRANSCRIPT
![Page 1: CS248 Final Review. CS248 Final Monday, December 6, 3:30 to 6:30 pm, Gates B01 Closed book, closed notes Mainly from material in the second half of the](https://reader036.vdocuments.us/reader036/viewer/2022062421/56649d4d5503460f94a2b442/html5/thumbnails/1.jpg)
CS248 Final ReviewCS248 Final Review
![Page 2: CS248 Final Review. CS248 Final Monday, December 6, 3:30 to 6:30 pm, Gates B01 Closed book, closed notes Mainly from material in the second half of the](https://reader036.vdocuments.us/reader036/viewer/2022062421/56649d4d5503460f94a2b442/html5/thumbnails/2.jpg)
CS248 FinalCS248 Final
• Monday, December 6, 3:30 to 6:30 pm, Gates B01
• Closed book, closed notes• 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
![Page 3: CS248 Final Review. CS248 Final Monday, December 6, 3:30 to 6:30 pm, Gates B01 Closed book, closed notes Mainly from material in the second half of the](https://reader036.vdocuments.us/reader036/viewer/2022062421/56649d4d5503460f94a2b442/html5/thumbnails/3.jpg)
CS248 Final Review CS248 Final Review ContentsContents
• Image warping, texture mapping• Perspective• Visibility• Lighting / Shading
![Page 4: CS248 Final Review. CS248 Final Monday, December 6, 3:30 to 6:30 pm, Gates B01 Closed book, closed notes Mainly from material in the second half of the](https://reader036.vdocuments.us/reader036/viewer/2022062421/56649d4d5503460f94a2b442/html5/thumbnails/4.jpg)
Texture MappingTexture Mapping
• Coordinate systems– [u,v,q] => [xo, yo zo, wo] => [xw, yw zw,
ww] => [x, y, w]
– Assuming all transforms are linear, then
– [A][u, v, q]’ = [x, y, w]
![Page 5: CS248 Final Review. CS248 Final Monday, December 6, 3:30 to 6:30 pm, Gates B01 Closed book, closed notes Mainly from material in the second half of the](https://reader036.vdocuments.us/reader036/viewer/2022062421/56649d4d5503460f94a2b442/html5/thumbnails/5.jpg)
Texture WarpsTexture Warps
• Rotation, translation• Perspective• Minification (decimation)
– unweighted average: average projected texel elements that fall within a pixel’s filter support
– area-weighted average: average based on area of texel support
![Page 6: CS248 Final Review. CS248 Final Monday, December 6, 3:30 to 6:30 pm, Gates B01 Closed book, closed notes Mainly from material in the second half of the](https://reader036.vdocuments.us/reader036/viewer/2022062421/56649d4d5503460f94a2b442/html5/thumbnails/6.jpg)
Texture WarpsTexture Warps
• Magnification– Unweighted– Area-weighted– bilinear interpolation
= texel
= pixel
![Page 7: CS248 Final Review. CS248 Final Monday, December 6, 3:30 to 6:30 pm, Gates B01 Closed book, closed notes Mainly from material in the second half of the](https://reader036.vdocuments.us/reader036/viewer/2022062421/56649d4d5503460f94a2b442/html5/thumbnails/7.jpg)
TexturesTextures
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
![Page 8: CS248 Final Review. CS248 Final Monday, December 6, 3:30 to 6:30 pm, Gates B01 Closed book, closed notes Mainly from material in the second half of the](https://reader036.vdocuments.us/reader036/viewer/2022062421/56649d4d5503460f94a2b442/html5/thumbnails/8.jpg)
QuestionsQuestions
• 1. What are some of the problems associated with Mipmaps?
• 2. What are some of the problems associated with SAT?
![Page 9: CS248 Final Review. CS248 Final Monday, December 6, 3:30 to 6:30 pm, Gates B01 Closed book, closed notes Mainly from material in the second half of the](https://reader036.vdocuments.us/reader036/viewer/2022062421/56649d4d5503460f94a2b442/html5/thumbnails/9.jpg)
Viewing: Planar Viewing: Planar ProjectionsProjections
• 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?
![Page 10: CS248 Final Review. CS248 Final Monday, December 6, 3:30 to 6:30 pm, Gates B01 Closed book, closed notes Mainly from material in the second half of the](https://reader036.vdocuments.us/reader036/viewer/2022062421/56649d4d5503460f94a2b442/html5/thumbnails/10.jpg)
Specifying Perspective Specifying Perspective ViewsViews
• Observer position (eye, center of projection)
• Viewing direction (normal to picture plane)
• Clipping planes (near, far, top, bottom, left, right)
![Page 11: CS248 Final Review. CS248 Final Monday, December 6, 3:30 to 6:30 pm, Gates B01 Closed book, closed notes Mainly from material in the second half of the](https://reader036.vdocuments.us/reader036/viewer/2022062421/56649d4d5503460f94a2b442/html5/thumbnails/11.jpg)
Viewing: OpenGL PipelineViewing: OpenGL Pipeline
• Object Space• Eye Coordinates• Projection Matrix• Clipped to Frustum• Homogenize to normalized device
coordinates• Window coordinates
![Page 12: CS248 Final Review. CS248 Final Monday, December 6, 3:30 to 6:30 pm, Gates B01 Closed book, closed notes Mainly from material in the second half of the](https://reader036.vdocuments.us/reader036/viewer/2022062421/56649d4d5503460f94a2b442/html5/thumbnails/12.jpg)
VisibilityVisibility
1.6 visible-surface determination algorithms:1.Z-buffer2.Watkins3.Warnock4.Weiler-Atherton5.BSP Tree6.Ray Tracing
![Page 13: CS248 Final Review. CS248 Final Monday, December 6, 3:30 to 6:30 pm, Gates B01 Closed book, closed notes Mainly from material in the second half of the](https://reader036.vdocuments.us/reader036/viewer/2022062421/56649d4d5503460f94a2b442/html5/thumbnails/13.jpg)
Things to knowThings to know
how does it workwhat are the necessary preconditions?asymptotic time complexitywell-suited for hardware?how can anti-aliasing be done?how can shading be incorporated?parallelizable?ease of implementationbest-case/worst-case scenarios
![Page 14: CS248 Final Review. CS248 Final Monday, December 6, 3:30 to 6:30 pm, Gates B01 Closed book, closed notes Mainly from material in the second half of the](https://reader036.vdocuments.us/reader036/viewer/2022062421/56649d4d5503460f94a2b442/html5/thumbnails/14.jpg)
Z-bufferZ-buffer
• Project all polygons to the image plane, at each pixel, pick the color corresponding to closest polygon
• What has to be done to render transparent polygons?
![Page 15: CS248 Final Review. CS248 Final Monday, December 6, 3:30 to 6:30 pm, Gates B01 Closed book, closed notes Mainly from material in the second half of the](https://reader036.vdocuments.us/reader036/viewer/2022062421/56649d4d5503460f94a2b442/html5/thumbnails/15.jpg)
WatkinsWatkins
• Scanline + depth– progressing across scanline, if pixel is
inside two or more polygons, use depth to pick
– process interpenetrating polygons, add those events
![Page 16: CS248 Final Review. CS248 Final Monday, December 6, 3:30 to 6:30 pm, Gates B01 Closed book, closed notes Mainly from material in the second half of the](https://reader036.vdocuments.us/reader036/viewer/2022062421/56649d4d5503460f94a2b442/html5/thumbnails/16.jpg)
Warnock SubdivisionWarnock Subdivision
• Start with area as original image– subdivide areas until either:
• all surfaces are outside the area• only one inside, overlapping or
surrounding• a surrounding surface obscures all other
surfaces
*
![Page 17: CS248 Final Review. CS248 Final Monday, December 6, 3:30 to 6:30 pm, Gates B01 Closed book, closed notes Mainly from material in the second half of the](https://reader036.vdocuments.us/reader036/viewer/2022062421/56649d4d5503460f94a2b442/html5/thumbnails/17.jpg)
Weiler-Atherton Weiler-Atherton SubdivisionSubdivision
• Cookie-cutter algorithm: clips polygons against polygons– front to back sort of list– clip with front polygon
Why is this so difficult?
![Page 18: CS248 Final Review. CS248 Final Monday, December 6, 3:30 to 6:30 pm, Gates B01 Closed book, closed notes Mainly from material in the second half of the](https://reader036.vdocuments.us/reader036/viewer/2022062421/56649d4d5503460f94a2b442/html5/thumbnails/18.jpg)
BSP Trees/List PriorityBSP Trees/List Priority
• 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
![Page 19: CS248 Final Review. CS248 Final Monday, December 6, 3:30 to 6:30 pm, Gates B01 Closed book, closed notes Mainly from material in the second half of the](https://reader036.vdocuments.us/reader036/viewer/2022062421/56649d4d5503460f94a2b442/html5/thumbnails/19.jpg)
Ray TracingRay Tracing
• “Ray Casting”– for each pixel, cast a ray into the
scene, and use the color of the closest polygon
– Parametric form of a line: u(t) = a+(b-a)t
– Implicit form of the objecta b
(0,0) x
y t
![Page 20: CS248 Final Review. CS248 Final Monday, December 6, 3:30 to 6:30 pm, Gates B01 Closed book, closed notes Mainly from material in the second half of the](https://reader036.vdocuments.us/reader036/viewer/2022062421/56649d4d5503460f94a2b442/html5/thumbnails/20.jpg)
LightingLighting
• 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
![Page 21: CS248 Final Review. CS248 Final Monday, December 6, 3:30 to 6:30 pm, Gates B01 Closed book, closed notes Mainly from material in the second half of the](https://reader036.vdocuments.us/reader036/viewer/2022062421/56649d4d5503460f94a2b442/html5/thumbnails/21.jpg)
Sample question (2000)Sample question (2000)
• Q. As every scout knows, you can start a fire on a sunny day by holding a magnifying glass between the sun and a piece of paper placed on the ground. – Is the radiance of the sun as seen from the
focal point of the lens more, less, or the same as the radiance as seen from the same point in the absence of the magnifying glass?
– Is the irradiance due to the sun at the focal point more, less, or the same as the irradiance at the same point in the absence of the magnifying glass?
![Page 22: CS248 Final Review. CS248 Final Monday, December 6, 3:30 to 6:30 pm, Gates B01 Closed book, closed notes Mainly from material in the second half of the](https://reader036.vdocuments.us/reader036/viewer/2022062421/56649d4d5503460f94a2b442/html5/thumbnails/22.jpg)
LightingLighting
• Point to area transport– Computing the irradiance to a surface– Cos falloff: N • L
– E = Fatt x I x (N • L)
![Page 23: CS248 Final Review. CS248 Final Monday, December 6, 3:30 to 6:30 pm, Gates B01 Closed book, closed notes Mainly from material in the second half of the](https://reader036.vdocuments.us/reader036/viewer/2022062421/56649d4d5503460f94a2b442/html5/thumbnails/23.jpg)
LightingLighting
• Lambertian (diffuse) surfaces– Radiant intensity has cosine fall off
with respect to angle– Radiance is constant with respect to
angle– Reason: the projected unit area ALSO
gets smaller as a cosine fall off!
– Fatt x I x Kd x (N • L)
N
VI length = cos(t)
Radiance intensity: intensity/solid angle
NV
![Page 24: CS248 Final Review. CS248 Final Monday, December 6, 3:30 to 6:30 pm, Gates B01 Closed book, closed notes Mainly from material in the second half of the](https://reader036.vdocuments.us/reader036/viewer/2022062421/56649d4d5503460f94a2b442/html5/thumbnails/24.jpg)
LightingLighting
• 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
– Don’t forget the generalizations to the BRDF!• Spatially/spectrally varying, florescence,
phosphorescence, etc.
![Page 25: CS248 Final Review. CS248 Final Monday, December 6, 3:30 to 6:30 pm, Gates B01 Closed book, closed notes Mainly from material in the second half of the](https://reader036.vdocuments.us/reader036/viewer/2022062421/56649d4d5503460f94a2b442/html5/thumbnails/25.jpg)
LightingLighting
• Phong specular model– Isn’t 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
N LR
V
![Page 26: CS248 Final Review. CS248 Final Monday, December 6, 3:30 to 6:30 pm, Gates B01 Closed book, closed notes Mainly from material in the second half of the](https://reader036.vdocuments.us/reader036/viewer/2022062421/56649d4d5503460f94a2b442/html5/thumbnails/26.jpg)
LightingLighting
• 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
![Page 27: CS248 Final Review. CS248 Final Monday, December 6, 3:30 to 6:30 pm, Gates B01 Closed book, closed notes Mainly from material in the second half of the](https://reader036.vdocuments.us/reader036/viewer/2022062421/56649d4d5503460f94a2b442/html5/thumbnails/27.jpg)
ShadingShading
• 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!
![Page 28: CS248 Final Review. CS248 Final Monday, December 6, 3:30 to 6:30 pm, Gates B01 Closed book, closed notes Mainly from material in the second half of the](https://reader036.vdocuments.us/reader036/viewer/2022062421/56649d4d5503460f94a2b442/html5/thumbnails/28.jpg)
ShadingShading
• Angle interpolation– interpolate normal angles according to the
implicit surface– compute shading at each point of the
implicit surface– CORRECT! But very expensive
![Page 29: CS248 Final Review. CS248 Final Monday, December 6, 3:30 to 6:30 pm, Gates B01 Closed book, closed notes Mainly from material in the second half of the](https://reader036.vdocuments.us/reader036/viewer/2022062421/56649d4d5503460f94a2b442/html5/thumbnails/29.jpg)
ShadingShading
• 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?
Implicit surfacePolygon approximation
N1 N2
![Page 30: CS248 Final Review. CS248 Final Monday, December 6, 3:30 to 6:30 pm, Gates B01 Closed book, closed notes Mainly from material in the second half of the](https://reader036.vdocuments.us/reader036/viewer/2022062421/56649d4d5503460f94a2b442/html5/thumbnails/30.jpg)
Lighting and ShadingLighting and Shading
• Know the OpenGL 1.1, 1.2 light equations (what terms mean what)
![Page 31: CS248 Final Review. CS248 Final Monday, December 6, 3:30 to 6:30 pm, Gates B01 Closed book, closed notes Mainly from material in the second half of the](https://reader036.vdocuments.us/reader036/viewer/2022062421/56649d4d5503460f94a2b442/html5/thumbnails/31.jpg)
Good Luck!Good Luck!
Good Luck on the Final!
![Page 32: CS248 Final Review. CS248 Final Monday, December 6, 3:30 to 6:30 pm, Gates B01 Closed book, closed notes Mainly from material in the second half of the](https://reader036.vdocuments.us/reader036/viewer/2022062421/56649d4d5503460f94a2b442/html5/thumbnails/32.jpg)
Ray TracingRay 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
![Page 33: CS248 Final Review. CS248 Final Monday, December 6, 3:30 to 6:30 pm, Gates B01 Closed book, closed notes Mainly from material in the second half of the](https://reader036.vdocuments.us/reader036/viewer/2022062421/56649d4d5503460f94a2b442/html5/thumbnails/33.jpg)
Exotic uses of texturesExotic uses of textures
• Environment/reflection mapping• Alphas for selecting between
textures/shading parameters• Bump mapping• Displacement mapping• Object placement• 3d textures