Exam Questions Flashcards
What is the ModelViewProjectionMatrix? What does it do?
The matrix that transforms from modelspace (via worldspace) into viewspace and finally into unit- or projectionspace (or normalized device coordinates or homogeneous coordinates).
Explain screen tearing.
Screen appears to be torn between multiple frames with an intense flickering effect. Solved by double buffering and syncing buffer swapping with the vblank.
What is the advantage of Bresenham’s line drawing algorithm?
It only uses integers, which used to be considerably cheaper than float values.
Assume that M is a matrix that is used to transform triangle vertices and that M nor necessarily is orthogonal. What is the matrix to correctly transform the normals?
(M^-1)^T
State which matrix components control 1) the scaling in x-, y- and z-direction, 2) rotations in general, and 3) translation in the x, y- and z-direction?
[a e i m]
[b f j n]
[c g k o]
[d h l p]
Rotation: abcefgijk
Scaling: x: a, y: f, z: k
Translation: x: m, y: n, z: o
State the object’s model-to-world matrix.
World space: x, y, z
Model space: a, b, y (Origin o)
[ax bx cx ox]
[ay by cy oy]
[az bz cz oz]
[ 0 0 0 1]
Give two reasons for gamma correction.
1) Screen output for CRT is non-linear (gamma) and needs to be countered (gamma correction) e.g. for correct antialiasing.
2) More efficient storage of color space (compressing to 8 bits).
Does the rendering order of transparent objects (e.g. triangles) matter? Motivate for point.
Yes, it matters because the blending operation (co = a * cs + (1 - a) * cd) is order dependent. (Unless you have a pure additive or multiplicative blending – but both are used for classic transparency.)
Describe how anisotropic filtering works. Also tell why its needed.
Up to 16 mipmap samples of a texel are taken along the middle (“line of anisotropy”) of the pixel projected onto the texel. Provides different amounts of filtering in the x and the y direction, i.e. avoids overblurring of simple mipmap.
What is a 2x2 grid, 2x2 RGSS, and 8 rooks? Draw them!
See e.g.: https://mynameismjp.files.wordpress.com/2012/10/supersampling-patterns.png
Assume you want to texture a quad (8 x 16) with a repeating chessboard pattern (4 x 4). You start by setting the texture wrap option to REPEAT. What texture coordinates (u,v) should you specify for each vertex v0, v1, v2, v3 to achieved the desired effect?
v0: (0,0), v1: (2,0), v2: (2,4), v3: (0,4)
Assume that you are rendering an impostor (i.e. billboard) as a rectangular quad. The impostor’s texture represents a tree and contains lots of fully transparent texels. How do you assure that objects that are later (for the same frame) rasterized behind the transparent parts of the impostor will show on the screen? (Hint: Use the fragment shader.)
Alpha testing in fragment shader i.e. test if alpha = 0 for a fragment, if yes discard (“kill”) fragment.
What is a vertex shader, geometry shader and fragment shader? Explain their functions respectively.
Vertex shader: Per vertex operations like projection to unit-cube (2D) and per-vertex attributes to be interpolated (color, normal).
Geometry shader: Take input primitives and output possibly another amount and possibly another type of primitive.
Fragment shader: Output pixel color from interpolated data from vertex shader.
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 is used to get better z-precision in the z buffer.
Describe a method for a ray-polygon intersection test. (You may assume that the polygon is convex and lies in a 3D plane.)
Convert to a point-in-2D-polygon test and use the crossing number algorithm / even-odd rule.
See also other methods:
- Analytical
- Geometrical
- Separating Axis Theorem (orthogonal or cross product axes)
Describe a test which determines whether or not two spheres intersect.
|| c1 - c2 || <= (r1 + r2)
Describe a test which determines whether 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 how to sort objects in (roughly) back-to-front order when they are stored in an Axis Aligned BSP-tree.
At each node:
If leaf, then draw the object.
Recursively continue traversal for the child at the further side of the node-plane.
Recursively continue traversal for the child at the hither side of the node-plane.
Name a sorting algorithm that is effective when we have high frame-to-frame coherency (regarding the objects to be sorted per frame)?
Bubble sort or insertion sort (expected complexity/runtime: O(n)).
How do you nicely terminate recursion in ray tracing if you do not simply want to terminate at a maximum recursion depth?
Terminate when the ray’s influence on the final pixel color is below a certain threshold. (Send a weight with the reflection/refraction rays.)
Describe a common recursive pattern for adaptive super sampling. Draw start samples, samples after one level of recursion and criteria to terminate or continue the recursion.
Start with quincunx sample.
Recursion through quincunx in corners.
Recursion if sufficient difference between corner and center, otherwise (or if above certain level of recursion).
Explain how a skippointer tree works and what the advantage is.
Stores in depth-first traversal order sequentially in an array, nodes store pointer/index to next element if traversal of subgraph should be skipped. Gives good cache coherence.
Explain Final Gather and how it is used with the photon maps (Caustics map and Global map). Also, explain what is good with Final Gather.
At first diffuse hit, instead of growing sphere in global map directly, sample indirect slow varying light by shooting 100-1000 indirect rays from p (Monte Carlo-sample) and grow sphere in the global map and also caustics map, where each of those
rays ends at a diffuse surface. Caustics at first intersection and global map at intersections of secondary rays.
Improves quality of global illumination by lowering noise from global map.
How are soft shadows from an area-light source computed with a path tracing?
At each intersection, one shadow ray is shot to one random position on the light source.