cs 354 final exam review
DESCRIPTION
May 3, 2012; CS 354 Computer Graphics; University of Texas at AustinTRANSCRIPT
CS 354Review for Final
Mark KilgardUniversity of TexasMay 3, 2012
CS 354 2
Today’s material
In-class quiz On surfaces & programmable tessellation
lecture Lecture topic
What to study for the final
CS 354 3
Daily Quiz1. How many control points
specify a bi-cubic Bezier path?
2. How many control points specify a Bezier triangle patch?
3. Programmable tessellation relies on two programmable shader stages. What are the names of these two stages? (Give either the OpenGL or Direct3D names.)
4. Multiple choice: Subdivision surfaces repeatedly apply these two steps
a) refinement & smoothing
b) divide & conquer
c) sort & merge
d) push & pop
e) push & pull
On a sheet of paper• Write your EID, name, and date• Write #1, #2, #3, #4 followed by its answer
CS 354 4
Last time, this time
Last lecture, we discussed Surfaces, programmable tessellation,
non-photorealistic graphics This lecture
Review for the final Course-Instructor survey
Last 10 minutes of class
Projects Project 4 on ray tracing on Piazza
Due Thursday May 3, 2012 (extended) As announced, no slip days Arrange your demo with TA for Friday, May 4
CS 354 5
Grading
Testing 60% Daily quizzes 10%
3-4 questions, easy
Homework 10% Occasional, mostly
math questions Project 0’s simple
rendering considered homework
Exams 40% Mid-term 15% Final 25%
Software projects 40% Object loader GLSL Shading Motion capture
animation Ray Tracer
CS 354 6
What will you learnWhat you should have learned
Fundamentals of computer graphics Transformations and viewing Rasterization and ray tracing Lighting and shading Graphics hardware technology Mathematics for computer graphics
Practical graphics programming OpenGL programming Shader programming Performance analysis
CS 354 7
When and whereis the final exam?
Thursday, May 10, 2:00-5:00 pm Three hours Afternoon
Burdine 116 Same room as
weekly lecture
you are here
CS 354 8
Exam Instructions & Policies
Open textbook Open notes, including lecture slides Calculators allowed/encouraged Prohibitions
No smart phones No computers No Internet access
Show your work to justify your answer and provide a basis for partial credit
Sit with an empty seat between each student
CS 354 9
Final exam generalities
Cumulative Covers material in both halves of the course Revisit your mid-term & homework assignments Knowledge from projects Textbook readings 1/3 first half, 2/3 second half
Exam structure Math questions Concept questions
Some multiple choice, some fill-in-the-blank, some true-or-false
No essay questions; some “explain briefly” questions About 80% longer than mid-term
CS 354 10
Final exam scope
Every lecture is covered by at least one exam question
Concepts developed in the projects is fair game
Variations of quiz questions, sometimes lifted exactly See Piazza for all the quiz answers
Search for #quiz
CS 354 11
Bezier Curve Formulation
Given control points, specify parametric formula for Bezier curve Quadratic (3 control points)
P0*(1-t)2 + 2*P1*(1-t)*t + P2*t2
Cubic (4 control points) P0*(1-t)3 + P1*3*t*(1-t)2 + P2*3*t2*(1-t)+P3*t3
Be prepared to evaluate the Bezier curve for various values of “t”
CS 354 12
Bezier Curves
Geometric intuition Given four cubic Bezier control points
P0, P1, P2, P3
What is the geometric interpretation of the vector from P0 to P1 and P2 to P3?
Be able to show these directions are the tangents of the curve at the end-points
Differentiate and evaluate at t=0 and t=1
CS 354 13
Bezier CurvesDe Casteljau's algorithm
Given a cubic Bezier curve C(t) Defined by control points P0, P1, P2, P3 How to evaluate C(t) with De Casteljau’s approach?
Make new points with linear interpolation AB = lerp(P0,P1,t) BC = lerp(P1,P2,t) CD = lerp(P2,P3,t) ABC = lerp(AB,BC,t) BCD = lerp(BC,CD,t) ABCD = lerp(ABC,BCD,t) lerp(a,b,t) = a+t*(b-a) = (1-t)*a + t*b
ABCD evaluates to C(t)
CS 354 14
De Casteljau's algorithmVisualized
CS 354 15
Bezier Subdivision
Original Bezier curve C(t) can be split into two sub-curves C1(t) and C2(t)
Assuming C(t)’s control points are P0, P1, P2, P3
C1(t)’s control points are P0,AB,ABC,ABCD
C2(t)’s control points are ABCD,BCD,CD,P3
CS 354 16
Bezier Surface Evaluation
Given bicubic Bezier path form Evaluate P(u,v) Also compute gradients dP/du and dP/dv Compute surface normal
Assume simple enough control points to make this tractable
CS 354 17
Ray Tracing MathRay-Sphere Intersection
Given ray with origin O and direction D ray(t) = O + D*t
Given sphere at C with radius r and P is on the sphere (P-C)•(P-C)=r2
Compute the values of t where the ray intersects the sphere Involves solving the quadratic formula
Interpretation of the intersection What does zero solutions mean? What does two solutions mean? What does one solution mean? What do parametric values of t<0 mean?
Compute actual point(s) of intersection of ray and sphere
CS 354 18
Ray Tracing MathRay-Sphere Shading
Given an intersection point on a sphere Determine the surface normal
Easy because normal N just normalized P-C Given lighting position L
Compute diffuse coefficient max(0,normalize(L-P)•N)
Why the max with zero? Given eye position E
Compute half-angle vector H=normalize(E-P+
CS 354 19
Ray Types
Eye (or view) rays From eye to surfaces
Light (or shadow) rays Surface in shadow of light if ray obstructed Surface illuminated by light if ray unobstructed
Reflected rays Specular bounce
Refracted rays Ray travels through interface Be able to compute refracted vector given incoming
ray direction, surface normal, and index of refraction Be able to identify types of rays in a diagram
CS 354 20
Rendering Equation
Be able to identify and briefly explain the constituent parts of the Rendering Equation
Explain two different forms What does each form integrate over?
Hemisphere of incoming directions at surface point All possible surface points in the scene
CS 354 21
Rendering Equation
Theory for light-surface interactions
dtLtftLtL ireo )(),,,(),,,,(),,,(),,,( nxxxx
CS 354 22
Rendering Equation Parts
Lo = outgoing light from x in direction ω x = point on a surface ω = normalized outgoing light vector λ = wavelength of light t = time Le = emitted light at x going towards from ω n = surface normal at x
dtLtftLtL ireo )(),,,(),,,,(),,,(),,,( nxxxx
CS 354 23
Rendering Equation Integral
∫ = integrate over a region Ω = region of a hemisphere
Together: “integrate overall the incoming directions for a hemisphere at a point x”
ωˊ = normalized incoming light vector Li = incoming light at x coming from ωˊ n = surface normal at x (-ωˊ • n) = cosine of angle between incoming
light and surface normal dωˊ = differential of incoming angle
CS 354 24
Bidirectional Reflectance Distribution Function
Ratio of differential outgoing (reflected) radiance to differential incoming irradiance
Physically based BRDF properties Must be non-negative Must be reciprocal
Swap incoming & relected directions generates same ratio Conserves energy
Integrating over entire hemisphere must be ≤ 1
dtdL
tdL
tdE
tdLtf
i
r
i
rr )(),,,(
),,,(
),,,(
),,,(),,,,(
nx
x
x
xx
L = radiance
E = irradiance
CS 354 25
Cosine Weighting for Irradiance
At shallow angles, incoming light spreads over a wider area of the surface Thus spreading the energy Thus dimming the received light
CS 354 26
o
Two Versions ofRendering Equation
dtLtf
tLtL
ir
e
o )(),,,(),,,,(
),,,(),,,( nxx
xx
yyxyx
xx
yx
y
yx dGtLtf
tLtL
r
e
o ),(),,,(),,,,(
),,,(),,,(
Integrate over hemisphere Integrate over all surface points
Occlusion (G) is zero
CS 354 27
Global Illumination Terms
Be able to explain Irradiance vs. radiance Form factor
Percent of energy from patch A that reaches (is transferred to) patch B
Radiosity Caustics
Photon mapping can simulate these Why can’t normal ray tracing simulate these?
CS 354 28
Typography
Typographic units Em, Pica, Point
Character encoding Unicode
How does Unicode relate to the 7-bit and 8-bit ASCII character sets?
Why is kerning done? Why font hinting? Why ClearType? Identify serif vs. non-serif type faces
CS 354 29
Resolution-independent 2D
What is a path? What is a contour? How are curved segments indicated?
Quadratic and cubic Bezier curves + elliptical arcs
How do you know if a point is within a path? Non-zero rule, even-odd rule
How are paths shaded (painted?) Gradients, solid color, images
CS 354 30
Blend Modes
Given f(Ac,Bc) and X, Y, Z parameters, build up a Porter-Duff blend equation
Evaluate that blend equation for a given source and destination RGBA value
CS 354 31
Graphics Pipeline Stages
Know their order Mid-term asked to order stages Worth revisiting
CS 354 32
Coordinate SpaceTransformations
Be able to recognize / specify the following coordinate space transformations Translate Rotate Scale (uniform, non-uniform) Orthographic view Perspective view
Be able to concatenate transformations Be able to transform normals and positions
by concatenated transformations
CS 354 33
Edge Equation Setupfor Rasterization
Given three points in window space, generate the three edge equations Front facing or back facing?
Test if pixel locations are inside/outside the triangle
CS 354 34
Plane Equation Setupfor Interpolation
Given window-space vertices for a triangle, be able to setup plane equation for interpolating Z
CS 354 35
Mipmap Generation
Extend to 3D textures How many bytes would a 256x128x128
texture take up? Width, height, and depth dimensions half with
successively smaller mipmap levels
Be able to generate texels for a small mipmap pyramid Say 8x2
CS 354 36
GLSL Shading Language
Be able to map implement simple GLSL standard library routines in GLSL as simple math operations and sqrt Example: length
sqrt(v.x*v.x+v.y*v.y+v.z*v.z) Others: dot, mul, normalize, reflect, refract,
distance, determinant Know the standard GLSL types
So you can not which types are not actual GLSL built-in types
CS 354 37
Scene Graph
Be able to identify when a bounding box is trivially outside a view frustum Are all its vertices on the “wrong” side of a
view frustum clip plane? Then trivially culled
Briefly distinguish View frustum culling Occlusion culling Portal culling
CS 354 38
Acceleration Structures
Name common acceleration structures Weight advantages and disadvantages
Explain ray traversal given a heirarchical acceleration structure
CS 354 39
Shadows
Name dominant shadowing algorithms for interactive rendering Understand their artifacts and limitations Order the shadow algorithm steps properly
Given 2D diagrams, be able to tell if points are “inside” or “outside” a shadow volume
CS 354 40
Color
Perform color space conversions RGB to YIQ
What is a color gamut?
CS 354 41
Particle system
Given a particle with initial velocity shooting it upward and gravity, when will it hit the ground? Involves solving a quadratic equation
Algorithmic complexity of N particles mutually attracted by inverse square law (gravity) How could this be reduced?
CS 354 42
Compression
Why does hardware’s DXTC/S3TC formats have a fixed compression ratio? What is the ratio?
Why is sampling chroma values at a lower frequency than luminance values a common compression technique?
CS 354 43
Forces Driving Improvements in Computer Graphics
Human desire for VisualIntuition and Entertainment
Embarrassing
Parallelism ofGraphics
Increasing
Semiconductor
Density
Particularly thehardware-amenable,
latency tolerantnature of rasterization
Particularlyinteractive video games
ComputerGraphics
Moore’sLaw
CS 354 44
Course-Instructor Survey
Instructor’s Name Mark Kilgard
Course Abbreviation and Number CS 354
Course Unique Number 53035
Semester and Year Spring 2012