tenta frågor Flashcards
What does the fragment shader do? (Hint: what is its input and output and
when is it executed?)
Receives interpolated values from vertex shader and computes fragment
color. E.g., refines lighting, adds textures, may modify depth
What is the z-buffer for?
to resolve visibility / avoid depth sorting.
While a normal might be normalized in the vertex shader, why do we generally
need to normalize it again in the fragment shader?
As values get interpolated between the vertices from the vertex shader to
the fragment shader, the interpolated normal in not necessarily normalized.
How can you implement fog using the fragment shader?
E.g., (linearly/exponentially) blend between the fragment color and fog
color based on the fragment’s depth. To get full points, draw or explain in more
detail
Normally, you would want to draw all geometry that is in front of the camera.
So, why is a near and far plane used for the view frustum?
Near plane is used to avoid a degenerate projection plane. Far plane can be
used to get better z-precision in the z buffer.
Describe a test which determines whether or not a sphere and a plane intersect
Insert the sphere center into the plane equation. If the result is smaller than
the radius, there is an intersection.
I.e., ||n•c + d|| <= r.
Describe a top-down approach to build an Axis Aligned BSP-tree for a scene.
Create minimal AABB around the whole scene. Split along an axis.
Recursively split the 2 parts alongs a new axis. Terminate if empty node, #triangles
< threshold or level >= max recursion depth. (Axis aligned: x-,y-,z-axis are the split
planes.)
Why can’t we use ray tracing to do an exact object-object collision detection
test?
Only tests a discrete subset of surface points and directions. A finite set of
rays may miss small intersections.
What is the point of using dynamic collision detection tests?
Objects may collide in space and time although they never collide in any
of the frames rendered at discrete time steps.
What is a BRDF? (You can answer by stating what the abreviation BRDF
stands for and assuming f() is a BRDF and describe its input parameters and what it
returns.)
Bidirectional Reflection Distribution Function. The function f(ωi
, ωo)
returns how much of the radiance from the incoming direction ωi
that is reflected in
the outgoing direction ωo.
What is caustics?
specular reflections or refractions that focus light
Describe the shadow map algorithm
- Render a shadow (depth) map from the light source.
- Render image from the eye. For each generated pixel, transform/warp the x,y,zcoordinate to light space and compare the depth with the stored depth value in the
shadow map (at the pixel position (x,y).
If greater → point is in shadow.
Else → point is not in shadow.
(Bias/offset is necessary due to disretization and precision problems.)
Tell which type of curve each image corresponds to. You can choose between
Bezier curve, Interpolation-curve, and Hermite-curve. To get any points, you must
also motivate your choice!
a) interpolation curve since the curve goes through the control points. b)
Hermite-curve since gradients are specified per control point. c) Bezier-curve since
two intermediate points are used to approximate the gradients in the end points.
What is direct illumination and what is indirect illumination? (No formulas
needed - words are enough.)
Direct illumination is the light that comes directly from a light source.
Indirect illumination is the inter-reflected light, such as reflections, irradiance,
shadows, caustics, etc.
Linear interpolation of (u,v) in screen space does not give perspective correct
texturing. Describe how perspective correct texture interpolation can be achieved.
In screen space, linearly interpolate (u/w, v/w, 1/w) from each vertex.
Then, per pixel: ui
= (u/w)i
/ (1/w)i
, where i means screen space interpolated value.