Velocer › 单词卡 › University of Wisconsin–Madison › CS 559: Computer Graphics · UW-Madison
CS 559: Computer Graphics · UW-Madison
Cards from the CS 559 lectures. · 作者:regret_minimizer · 281 张卡片
- Do fillRect(), strokeRect(), and clearRect() modify the current path?No — they operate immediately without modifying the current path.
- What does clearRect(x, y, w, h) do?It immediately clears the specified rectangular region without modifying the current path.
- What is immediate-mode path rendering in canvas?Paths are built step by step in a buffer via commands like beginPath, moveTo, and lineTo, then rasterized once by fill() or stroke().
- What defines a simple polygon?A polygon whose boundary edges never intersect except at shared vertices.
- What is a convex polygon?A polygon where every interior angle is ≤ 180°, any line segment between two interior points lies entirely inside, and perimeter turns are all in one direction.
- What is a concave (non-convex) polygon?A simple polygon that has at least one interior reflex angle greater than 180°.
- For a simple polygon, how do the even-odd and non-zero winding fill rules compare?They produce the exact same filled region; they differ only on self-intersecting paths or overlapping subpaths.
- How does the even-odd fill rule determine if a point is inside a polygon?Cast a ray from the point to infinity, count boundary crossings k, and the point is inside if k is odd.
- What is the key difference between even-odd and non-zero winding rules on self-intersecting paths?They can produce different filled regions because the non-zero rule considers edge direction (winding number) while the even-odd rule only counts crossings.
- What problem does double buffering solve in graphics rendering?It prevents screen tearing and flicker during redraws by ensuring the display never shows a partially rendered frame.
- In double buffering, what is the difference between the front buffer and the back buffer?The display controller reads from the front buffer, while the application renders the next frame into the off-screen back buffer.
- What is the parametric (function-of-time) form of motion?Position is computed directly from elapsed time t, e.g., x(t) = xc + R·cos(ωt), y(t) = yc + R·sin(ωt). It is exact and drift-free for all t.
- What is the Euler differential update method for animation?State is updated incrementally via tangent velocity: x_{k+1} = x_k + Δt·v_x(x_k, y_k).
- What error accumulates with Euler differential updates, and why?Numerical integration error accumulates (e.g., an outward spiral drift) because each step approximates the true path.
- Why does Euler integration vary with frame rate, and how is this fixed?Because updates depend on step count rather than elapsed time; scaling each step by the actual frame time Δt makes motion frame-rate independent.
- Which motion approach is drift-free over long durations: parametric or Euler?Parametric (function-of-time) motion is exact and drift-free for all t, unlike Euler state-stepping.
- In the coordinate-system view, what does each call to translate, rotate, or scale do?It modifies the current local coordinate frame in which subsequent drawing commands execute.
- In the object view, if code calls T1, then T2, then T3, and draws vertex p, what is the final canvas position?p' = T1 T2 T3 p. Viewed in fixed global coordinates, T3 acts on the object first, then T2, then T1.
- What transformation matrix rotates or scales around an arbitrary pivot point (cx, cy)?M_pivot = T(cx, cy) · R(θ) · T(-cx, -cy). In Canvas code: translate(cx, cy) → rotate(theta) (or scale(sx, sy)) → translate(-cx, -cy).
- How do you compute the orientation angle θ(t) to orient an object along a parametric path p(t) = (x(t), y(t))?θ(t) = atan2(dy/dt, dx/dt), approximated by atan2(y(t+Δt) - y(t), x(t+Δt) - x(t)).
- What is a rigid body transformation (Euclidean isometry) in 2D?A transformation that preserves pairwise distances between all points and preserves handedness (orientation). In 2D, only translations and rotations (and their compositions) are rigid.
- Why are uniform or non-uniform scaling and reflections not rigid motions?Scaling changes distances; reflections (negative scaling such as scale(-1, 1)) preserve distances when |det|=1 but flip handedness (det = -1), so they are not rigid motions.
- What does context.save() do in a state stack?It pushes a copy of the current transformation matrix (and styling state) onto an internal LIFO stack.
- What does context.restore() do?It pops the top state off the stack, discarding any child transformations applied since the matching save().
- What happens to transformations applied after a save() when you call restore()?They are discarded, and the transformation state reverts to the saved copy.
- Why must save() and restore() be properly matched?Because restore() pops the most recent saved state; unmatched calls cause the stack to underflow or leave stale states, corrupting subsequent transformations.
- What is an articulated figure in the context of scene trees?A hierarchical model of connected parts (e.g., a multi-joint robot arm) where each part's transform is relative to its parent.
- How is an articulated figure's scene tree rendered?Via depth-first traversal, visiting each node and applying its transformation before descending to children.
- In a scene tree, how is a child node's transformation computed?It is composed with (relative to) its parent's transformation, so parent motion propagates to all descendants.
- Why is depth-first traversal used to render articulated hierarchies?It naturally applies each parent's transform before its children, ensuring correct cumulative positioning of every joint.
- What is the relationship between save()/restore() and rendering a scene tree?save()/restore() bracket each node's local transform during traversal so sibling branches don't inherit each other's transformations.
- What is a transformation stack used for?To temporarily store and restore transformation (and styling) states, enabling nested or hierarchical transformations without manual recomputation.
- What is the key difference in scene storage between immediate mode (canvas) and retained mode (SVG/THREE.js)?Immediate mode has no persistent object memory—pixels are painted directly into a bitmap buffer. Retained mode keeps an explicit scene graph/DOM tree of objects.
- In immediate mode rendering, how must animation frames be updated?The application must clear the canvas and execute all drawing calls every frame.
- In retained mode rendering, how are animations updated?The application mutates object properties or transforms, and the browser or engine re-renders automatically.
- How is hierarchy represented in immediate mode (canvas)?Implicitly, through the call stack using save() and restore().
- How is hierarchy represented in retained mode (SVG/THREE.js)?Explicitly, through parent-child container nodes such as <g transform="translate(...) rotate(...)"> or THREE.Group.
- What does immediate mode paint into instead of storing objects?A bitmap buffer—pixels are painted directly with no persistent object memory.
- What structures does retained mode use to store scene objects?An explicit scene graph or DOM tree, such as <g>, <rect>, THREE.Group, and THREE.Mesh.
- Which rendering mode requires the application to clear and redraw everything each frame?Immediate mode (canvas).
- Which rendering mode lets the browser or engine handle re-rendering after property changes?Retained mode (SVG/THREE.js).
- What canvas functions provide implicit hierarchy in immediate mode?save() and restore().
- What SVG element provides explicit parent-child hierarchy with transforms?The <g> element, e.g., <g transform="translate(...) rotate(...)">.
- What two properties must a linear transformation satisfy?Superposition: f(x + y) = f(x) + f(y), and homogeneity: f(cx) = c f(x). Equivalently, it can be written as matrix multiplication f(x) = Mx.
- What point does every linear transformation map the origin to?The origin: f(0) = 0. Linear transformations always fix the origin.
- What is the 2D rotation matrix R(θ) for a counterclockwise rotation?R(θ) = [[cosθ, -sinθ], [sinθ, cosθ]]. Its inverse is its transpose, R(θ)^T = R(-θ), and its determinant is 1.
- What is the inverse of a 2D rotation matrix R(θ)?R(θ)^(-1) = R(θ)^T = R(-θ). Rotation matrices are orthogonal with determinant 1.
- Write the 2D scaling matrix S(sx, sy).S(sx, sy) = [[sx, 0], [0, sy]]. It scales x by sx and y by sy.
- Write the 2D shear matrix for shearing along x by factor kx.Shear_x(kx) = [[1, kx], [0, 1]]. It shifts x by kx times y while leaving y unchanged.
- What is an affine transformation, and how does it differ from a linear transformation?An affine transformation is f(x) = Mx + v: a linear transformation followed by a translation. Unlike a linear transformation, it does not fix the origin when v ≠ 0.
- What geometric properties does an affine transformation preserve?It preserves colinearity (straight lines map to straight lines), parallelism, and ratios of distances along lines.
- How is a 2D point (x, y) represented in homogeneous coordinates?As the 3D vector [x, y, 1]^T, lying on the w = 1 plane.
- How are 2D displacement vectors represented in homogeneous coordinates, and why?As [vx, vy, 0]^T. The w = 0 component ensures they are unaffected by translation, since vectors represent directions, not positions.
- In homogeneous coordinates, what kind of 3D transformation represents a 2D translation?A 3D linear shear that leaves the w = 1 plane invariant. The translation appears in the third column of the 3×3 matrix.
- In the homogeneous 3×3 matrix [[a, c, e], [b, d, f], [0, 0, 1]], what does each column represent geometrically?Column 1 [a, b]^T is the transformed x̂ basis vector; column 2 [c, d]^T is the transformed ŷ basis vector; column 3 [e, f]^T is the transformed origin.
- What is the difference between context.transform and context.setTransform in the Canvas API?context.transform(a, b, c, d, e, f) post-multiplies the current transformation matrix by the given matrix, composing it with existing transforms. context.setTransform(...) overwrites the current matrix directly.
- How does a general homogeneous point [x, y, w]^T with w ≠ 0 map to a Euclidean 2D point?It projects to (x/w, y/w) via the perspective divide. Points with w = 0 represent directions at infinity.
- Why does a 2D rotation appear clockwise on a Y-down Canvas coordinate system even though R(θ) is counterclockwise in standard math coordinates?Because the Canvas y-axis points downward, which flips the visual orientation. The same matrix produces a clockwise rotation on screen.
- What is the explicit form of a curve, and what are its limitations?Explicit form is y = f(x). It fails for vertical tangents and closed loops because those have multiple y values for a single x.
- What is the implicit form of a curve, and what is it good for?Implicit form is F(x, y) = 0, such as x^2 + y^2 - r^2 = 0. It makes it easy to test whether a point lies on the curve (inside/outside test), but hard to enumerate points sequentially along the path.
- What is the parametric form of a curve?A parametric curve is f(u) = (x(u), y(u)) for u in [0, 1], where each coordinate is a function of a parameter u.
- Why is parametric form ideal for drawing curves?Because you can step through parameter values u = 0, Δu, 2Δu, ..., 1 and compute points sequentially along the path.
- Which curve representation naturally handles arbitrary orientations, self-intersections, and 3D space curves?Parametric form, since coordinates are independent functions of a parameter rather than tied to x or y.
- Why does explicit form y = f(x) fail for closed loops?A closed loop has multiple y values for a single x, so it cannot be expressed as a single-valued function y = f(x).
- Why does explicit form y = f(x) fail at vertical tangents?At a vertical tangent the slope is infinite, so y cannot be expressed as a function of x there.
- What is Runge's oscillation and why does it matter for splines?It is the oscillation that arises when fitting a single high-degree polynomial to many points; it is a reason to use piecewise cubics instead.
- What does it mean that high-degree polynomials are non-local?Moving a single data point perturbs the entire curve, rather than affecting only a local region.
- What is the goal of arc-length parameterization?To move an object along a curve at constant spatial speed, independent of how the parameter u varies.
- How is the cumulative arc-length lookup table built numerically?Sample u_k in [0, 1] and accumulate chord lengths: s(u_k) = Σ ‖f(u_j) − f(u_{j−1})‖ for j = 1 to k.
- Given a target distance s_target = v·t, how do you find the position along the curve?Find bracketing table entries with s(u_k) ≤ s_target ≤ s(u_{k+1}), linearly interpolate u between them, then evaluate f(u).
- In Reynolds boids, what state does each agent maintain?Position and velocity: (x, y, v_x, v_y), updated via local steering forces.
- What is the Separation rule in boids?A steering force that keeps agents apart to avoid crowding and collisions with nearby neighbors.
- What is the Alignment rule in boids?A steering force that makes an agent match the average heading of its neighbors.
- What is the Cohesion rule in boids?A steering force that steers an agent toward the average position of its neighbors.
- Besides the three flocking rules, what other forces can act on boids?Mouse/obstacle attraction or repulsion forces.
- What are the three classic Reynolds flocking steering behaviors?Separation, Alignment, and Cohesion.
- Why is linear interpolation used in arc-length parameterization?The lookup table only stores discrete samples, so u is interpolated between the bracketing entries to approximate the target arc length.
- In the right-handed 3D coordinate convention used by WebGL/THREE.js, which direction does the +z axis point?+z points out of the screen toward the viewer. The camera looks down the −z axis in view space.
- What is the viewing volume of an OrthographicCamera, and how does apparent object size behave with depth?It is an axis-aligned rectangular box. Parallel lines stay parallel and apparent object size is independent of depth z.
- What shape is the viewing volume of a PerspectiveCamera, and what bounds it?It is a truncated pyramid called a frustum, bounded by the near and far clipping planes, the vertical field-of-view angle fov (degrees), and the width-to-height aspect ratio.
- In perspective projection, how is a 3D point (x, y, z) mapped to the image plane at focal distance d?Via similar triangles: multiply by d and perform the perspective divide by w = z, giving (dx/z, dy/z).
- What is foreshortening in perspective projection?The effect where dividing by depth z makes distant objects appear smaller, so apparent size depends on distance.
- What three elements define camera pose in THREE.js?Eye position (camera.position), target point (camera.lookAt(target)), and up vector (camera.up, default [0,1,0]ᵀ).
- For a moving vehicle with position p, forward tangent v, and surface normal n, how is a first-person camera configured?position = p, lookAt = p + v, up = n.
- How is a third-person chase camera positioned relative to a vehicle at p with forward v and up n?position = p − αv + βn, and lookAt = p.
- How is a top-down overhead camera configured for a vehicle at p with normal n and forward v?position = p + βn, lookAt = p, and up = v (or the binormal b).
- How do you compute the binormal (right) vector b for a vehicle with forward tangent v and surface normal n?b = v × n (the cross product of forward and up).
- Key difference: do parallel lines remain parallel under orthographic or perspective projection?Under orthographic projection parallel lines remain parallel; under perspective projection they converge (foreshortening).
- In perspective projection, what does the perspective divide accomplish?It divides the projected coordinates by w = z, producing (dx/z, dy/z) so that depth affects apparent size.
- What conditions must a 3×3 matrix R satisfy to be a valid 3D rotation matrix in SO(3)?R must be orthonormal (RᵀR = I, so R⁻¹ = Rᵀ) and have determinant +1.
- Do 3D rotation matrices commute?No. For example, R_x(α)R_y(β) ≠ R_y(β)R_x(α); the order of rotations matters.
- State Euler's Rotation Theorem.Any 3D rotation (or sequence of rotations fixing the origin) is equivalent to a single rotation by some angle θ about some fixed unit axis v̂.
- What are Euler angles?A decomposition of a rotation into three sequential rotations about coordinate axes, specified with an order such as 'XYZ', 'ZYX', or 'ZYZ'.
- What is gimbal lock?A loss of one degree of freedom that occurs when the middle rotation aligns the first and third rotation axes so they rotate about the same world direction.
- For Tait-Bryan Euler orders with three distinct axes (e.g., XYZ, ZYX), at what middle angle does gimbal lock occur?When the middle angle is ±90° (±π/2).
- For proper Euler orders with repeated first/last axes (e.g., ZYZ, ZXZ), at what middle angle does gimbal lock occur?When the middle angle is 0° or 180° (0 or π).
- What are Hamilton's rules for quaternion units i, j, k?i² = j² = k² = ijk = −1, with ij = k = −ji, jk = i = −kj, and ki = j = −ik.
- How do you encode a rotation of angle θ about unit axis v̂ = (v_x, v_y, v_z) as a quaternion?q = (cos(θ/2), sin(θ/2)·v_x, sin(θ/2)·v_y, sin(θ/2)·v_z), which has unit norm.
- Why do quaternions use half-angles (θ/2)?A rotation is applied by sandwiching a point as q·p·q⁻¹, which applies θ/2 twice, yielding a net rotation of θ.
- What is the relationship between quaternions q and −q?They represent the same 3D rotation.
- What is the inverse of a unit quaternion q = (a, u)?q⁻¹ = q* = (a, −u), the conjugate.
- What are the advantages of quaternions over rotation matrices?They are compact (4 floats vs. 9), immune to gimbal lock, easy to compose (q_total = q₂q₁), and support smooth constant-speed SLERP interpolation.
- What does SLERP stand for and what does it do?Spherical Linear Interpolation; it smoothly interpolates between two quaternions at constant speed, e.g., q1.slerp(q2, u).
- How is the total rotation of composing two quaternion rotations q₁ then q₂ written?q_total = q₂q₁ (quaternion product).
- What is the determinant of any matrix in SO(3)?+1.
- Why are triangles preferred for building 3D meshes?Three non-collinear points always define a unique flat plane, and a triangle is guaranteed to be convex. Any polygon can be triangulated into triangles.
- How does an indexed BufferGeometry store vertex positions?Unique vertex positions are stored in a flat Float32Array via a position BufferAttribute with item size 3 (x, y, z per vertex).
- How does an indexed BufferGeometry define faces?Faces are defined by integer triples of vertex indices using geometry.setIndex([i0, i1, i2, ...]), so vertices are shared between triangles.
- What is the counterclockwise (CCW) winding convention for front-facing triangles?Vertices of a front-facing triangle are listed counterclockwise when viewed from outside the surface. This determines which side is front-facing for backface culling.
- How is the outward geometric normal of a triangle computed?N = (p2 − p1) × (p3 − p1), using the cross product of two triangle edges following the Right-Hand Rule.
- How do you achieve flat shading with sharp edges on an indexed mesh?Duplicate vertices along sharp edges so each face has its own perpendicular normal vector, as with a cube or die.
- How do you achieve smooth shading on curved surfaces?Share vertex indices across adjacent triangles and assign each vertex the normalized average of its adjacent face normals, e.g., with geometry.computeVertexNormals().
- How are normals handled during rasterization in smooth shading?Each vertex stores an averaged normal, and the rasterizer interpolates those normals smoothly across the triangle's face.
- What causes cracks in a mesh?Cracks occur when vertices that should be shared are unshared and drift apart after transformation, leaving gaps in the surface.
- What is a T-junction in a triangle mesh?A T-junction is where a vertex of one triangle lies in the middle of another triangle's edge without being shared. It causes pixel cracks during rasterization.
- What defines a watertight manifold mesh?A mesh with no cracks and no T-junctions, where edges and vertices are properly shared so the surface is closed and continuous.
- What does geometry.setIndex() do in Three.js?It defines the mesh's faces by supplying a flat list of integer vertex index triples, allowing vertices to be shared across triangles.
- What does geometry.computeVertexNormals() do?It computes each vertex normal as the normalized average of its adjacent face normals, producing smooth shading across shared vertices.
- What is backface culling based on?It is based on triangle winding order: front-facing triangles are wound counterclockwise as seen from outside, so clockwise-facing triangles are culled.
- In Loop subdivision, how is a new edge vertex computed for an interior edge (A,B) shared by triangles ABC and ABD?v_edge = (3/8)(A + B) + (1/8)(C + D).
- In Loop subdivision, how is a new edge vertex computed for a boundary edge (A,B)?v_edge = (1/2)(A + B).
- In Loop subdivision, what is the smoothing rule for an original vertex v with n neighbors?v' = (1 - nβ)v + β Σ v_i, where β = 3/16 if n = 3, and β = 3/(8n) if n > 3.
- What is the value of β in Loop subdivision when an original vertex has exactly 3 neighbors?β = 3/16.
- What is the value of β in Loop subdivision when an original vertex has n > 3 neighbors?β = 3/(8n).
- What does Catmull-Clark subdivision do to a k-gon face?It splits the k-gon into k quads, eliminating all non-quads after the first pass.
- In Catmull-Clark subdivision, how is a face point f_i computed?It is the average of all vertices of face i.
- In Catmull-Clark subdivision, how is an edge point e_j computed?It is the average of the edge's two endpoints and the two adjacent face points: (A + B + f_1 + f_2)/4.
- In Catmull-Clark subdivision, how is an original vertex v updated given valence n, average F of incident face points, and average R of incident edge midpoints?v' = (F + 2R + (n - 3)v) / n.
- What type of mesh does Loop subdivision apply to, and how does it split each triangle?It applies to triangle meshes and splits each triangle into 4 triangles (1 to 4 split).
- What type of mesh does Catmull-Clark subdivision apply to?It applies to quad and general polygon meshes, splitting each quad into 4 quads and each k-gon into k quads.
- What are the two main steps of Loop subdivision?Step 1: refinement by inserting a new midpoint vertex on every edge (odd edge vertices). Step 2: smoothing by updating each original vertex (even vertices).
- What is another name for morph targets?Blend shapes.
- How do morph targets deform a mesh?They directly interpolate vertex positions across K meshes that share identical vertex and triangle topology, using weights: p(u) = Σ w_k(u) p_k.
- What requirement must meshes satisfy to be used as morph targets?They must have identical vertex and triangle topology.
- In linear blend skinning, what data does each vertex store?Indices and weights w_i (summing to 1) for up to 4 influencing bones.
- What is the linear blend skinning formula for transforming a vertex?p' = (Σ_{i=1}^{4} w_i M_i) p_0, where M_i are the bone transformation matrices and w_i the bone weights.
- How many bones can influence a single vertex in linear blend skinning as described?Up to 4 bones.
- What constraint applies to the bone weights of a vertex in linear blend skinning?The weights must sum to 1.
- What is the key difference between morph targets and skeletal skinning?Morph targets interpolate vertex positions across pre-made meshes with identical topology, while skeletal skinning blends bone transformation matrices to deform a bound mesh.
- What does M_i represent in the linear blend skinning equation?The transformation matrix of the i-th influencing bone.
- What does p_0 represent in the linear blend skinning equation?The vertex's original (rest) position before skinning.
- What does w_k(u) represent in the morph target formula?The blend weight for the k-th morph target mesh at parameter u.
- What is the barycentric coordinate representation of a point p in the plane of triangle p1p2p3?p = αp1 + βp2 + γp3, with the constraint α + β + γ = 1. Every point in the triangle's plane has a unique such representation.
- When is a point p inside triangle p1p2p3 in terms of its barycentric coordinates?p is inside the triangle if and only if α, β, and γ all lie in [0, 1].
- How is the barycentric coordinate α computed using an area ratio?α = Area(△p p2 p3) / Area(△p1 p2 p3), the ratio of the sub-triangle opposite p1 to the full triangle.
- Given α and β, how is the third barycentric coordinate γ found?γ = 1 − α − β.
- How are per-vertex attributes like UV coordinates interpolated across a triangle?Using barycentric weights: (u, v) = α(u1, v1) + β(u2, v2) + γ(u3, v3). The same weighting applies to colors and normals.
- What does ClampToEdgeWrapping do when UV coordinates fall outside [0, 1]?It clamps the coordinates to the [0, 1] range, so edge texels are stretched outward.
- What does RepeatWrapping do with UV coordinates outside [0, 1]?It tiles the texture by taking the fractional part (u mod 1), repeating the texture indefinitely.
- How does MirroredRepeatWrapping differ from RepeatWrapping?It alternates forward and backward tiling, mirroring the texture on each repetition instead of restarting it identically.
- What is texture magnification, and when does it occur?It occurs when one texel covers many screen pixels, e.g., when the camera is very close to the surface.
- What is the difference between NearestFilter and LinearFilter (bilinear) during magnification?NearestFilter picks the single closest texel center, giving a blocky look; bilinear filtering interpolates the 4 surrounding texels horizontally and vertically for a smooth gradient.
- What is texture minification, and when does it occur?It occurs when one screen pixel covers many texels, e.g., when a surface is far away or viewed at a grazing angle.
- Why does point sampling cause shimmering/aliasing during minification?Jumping across many texels per pixel misses intermediate colors, producing severe shimmering and aliasing artifacts.
- What is MIP mapping and what does each level contain?A precomputed image pyramid of downsampled textures where level L has resolution (W/2^L) × (H/2^L), each texel averaging 2×2 texels from level L−1.
- How much extra memory does a full MIP map chain require?Only about 1/3 extra memory beyond the original texture.
- What does trilinear filtering (LinearMipmapLinearFilter) do?It performs bilinear interpolation within the two adjacent MIP levels L1 = ⌊L⌋ and L2 = ⌈L⌉ (8 texel lookups), then linearly interpolates between those two results.
- What does a bump map store, and what does it modify?It stores a grayscale height h(u,v) in [0,1] and perturbs the surface normal using height derivatives. It does not change the object's silhouette.
- How are normal vectors encoded in a normal map's RGB channels?(R,G,B) = ½(Nx+1, Ny+1, Nz+1), i.e., each component is remapped from [-1,1] into [0,1].
- What is the key difference between a bump map and a normal map?Both perturb the surface normal without changing geometry, but a bump map stores grayscale height (normal derived from derivatives) while a normal map stores the normal vectors directly.
- Which texture map actually changes an object's silhouette/geometry, and why?The displacement map, because it offsets real 3D vertex positions in the vertex shader (p' = p + d(u,v)N̂). It requires a densely tessellated mesh.
- What does a displacement map store and where is it applied?It stores a grayscale height offset d(u,v) and is applied in the vertex shader to move actual vertex positions along the normal.
- Do color/albedo maps change an object's silhouette?No. They only set diffuse/ambient reflectance (surface color) and leave geometry unchanged.
- What do metalness, roughness, light, and AO maps store and modify?They store scalar material properties per texel and modify specular/diffuse weights or apply pre-baked static shadows. They do not change geometry.
- What does an environment map (envMap/CubeMap) contain?Six faces forming a skybox cube that surrounds the scene, used to reflect the view ray off the surface normal.
- Do environment maps use mesh UV coordinates?No. Reflections are computed by reflecting the view ray R̂ off the surface normal N̂, not by sampling with mesh UVs.
- How are dynamic reflections achieved if a static skybox isn't enough?By using a CubeCamera to render the surrounding scene into a cube map dynamically.
- What does a shadow map store, and from what perspective is it rendered?It stores a depth buffer rendered from the light source's perspective.
- How does shadow mapping determine whether a fragment is in shadow?It compares the fragment's distance to the light against the closest depth stored in the shadow map.
- Why does displacement mapping require dense mesh tessellation?Because it moves actual vertices; without enough vertices the displaced surface cannot represent fine detail and the effect is coarse.
- What does a color/albedo map store and what does it modify?It stores RGB surface color and modifies diffuse/ambient reflectance (cd, ca). It does not alter geometry.
- Why must normals be transformed by the inverse-transpose matrix (M⁻¹)ᵀ instead of M?Non-uniform scaling shears tangent vectors by M, so M·N stops being perpendicular to the surface. Transforming by (M⁻¹)ᵀ preserves the perpendicularity condition N'ᵀ(M·T) = 0.
- For pure rotation matrices, what does the normal matrix (R⁻¹)ᵀ simplify to?It simplifies to R itself, since (R⁻¹)ᵀ = R for rotations.
- How does the Painter's Algorithm determine visibility?It sorts triangles from back to front by depth and draws them in that order, so nearer triangles overwrite farther ones.
- What are the main flaws of the Painter's Algorithm?It requires O(N log N) re-sorting whenever the camera moves, and it fails on intersecting triangles or cyclic overlap unless triangles are split.
- What is cyclic overlap, which breaks the Painter's Algorithm?A situation where triangle A overlaps B, B overlaps C, and C overlaps A, so no valid back-to-front ordering exists without splitting geometry.
- How does the Z-Buffer algorithm store visibility information?It keeps an extra depth value z(x,y) per pixel, initialized to infinity (far), and only lets a fragment write color if its depth is closer.
- What is the time complexity of the Z-Buffer algorithm, and does draw order matter?It runs in O(N) time and triangles can be drawn in any order.
- What is Z-fighting?When two coplanar or nearly coplanar polygons have depths equal within floating-point precision, producing noisy flickering stripes.
- How can Z-fighting be mitigated?By offsetting the geometry slightly or by bringing the near and far clipping planes closer together to preserve depth precision.
- Why can't the Z-buffer handle semi-transparent surfaces directly?Semi-transparent surfaces (alpha < 1) cannot simply overwrite or be discarded by the Z-buffer, since blending with what's behind is required.
- What is the correct rendering order for handling transparency with a Z-buffer?Render opaque objects first with Z-writes enabled, then render transparent objects sorted back-to-front with alpha blending.
- What condition must the inverse-transpose normal transform preserve?It must preserve N'ᵀ(M·T) = 0, i.e., the transformed normal stays perpendicular to the transformed tangent.
- What does the uniform qualifier mean in GLSL?A value that is constant across an entire draw call (per-object or per-frame), shared by all vertices and fragments. It is read-only in both the vertex and fragment shaders.
- Which shader stages can access a uniform variable?Both the vertex shader and the fragment shader. Uniforms flow from the JavaScript host to both stages.
- What does the attribute qualifier mean in GLSL?A per-vertex value (one per vertex in the mesh buffer) supplied from JavaScript BufferGeometry. It is read-only and available only in the vertex shader.
- Which shader stage can access attribute variables?Only the vertex shader. Attributes are unavailable in the fragment shader.
- What does the varying qualifier do in GLSL?It passes data from the vertex shader to the fragment shader, with values barycentrically interpolated per-pixel by the rasterizer.
- How is a varying variable's value determined in the fragment shader?The vertex shader writes it per-vertex, then the rasterizer interpolates it barycentrically across the primitive to produce a per-pixel value.
- What is the mutability of a varying variable in each shader stage?It is written in the vertex shader and read-only in the fragment shader.
- What are the three component-access naming sets for GLSL vector swizzling?.xyzw, .rgba, and .stpq.
- What does the swizzle v.zyx produce for vec4 v = vec4(1.0, 2.0, 3.0, 4.0);?vec3(3.0, 2.0, 1.0) — it rearranges the components in reverse order.
- What is the data flow direction for a uniform variable?From the JavaScript host to both the vertex and fragment shaders.
- What is the data flow direction for an attribute variable?From JavaScript BufferGeometry to the vertex shader only.
- What is the data flow direction for a varying variable?From the vertex shader, through the rasterizer, to the fragment shader.
- What granularity/frequency does a uniform have?Constant across an entire draw call — per-object or per-frame.
- What granularity/frequency does an attribute have?Per-vertex — one value per vertex in the mesh buffer.
- What does the local Phong illumination equation compute?It computes the color/intensity at a surface point as the sum of emissive, ambient, Lambertian diffuse, and Phong specular terms from ambient light and point/directional lights.
- In the Phong model, what does the unit light vector L̂_i represent?It points from the surface point toward light i (the direction to the light).
- In the Phong model, what does the unit view direction Ê represent?It points from the surface toward the eye/camera.
- What is the formula for the mirror reflection vector R̂ in the Phong model?R̂ = 2(N̂·L̂)N̂ − L̂, where N̂ is the unit normal and L̂ points from the surface to the light.
- Why does GLSL's reflect function use reflect(-L, N) for Phong reflection?GLSL's reflect(I, N) expects the incident vector I pointing toward the surface, so you pass -L (since L points from the surface toward the light).
- What is the Lambertian diffuse term in the Phong equation?c_d · max(0, N̂·L̂_i), which scales the diffuse color by the cosine of the angle between the normal and light direction.
- What is the Phong specular term?c_s · max(0, Ê·R̂_i)^p, using the dot product of view and reflection directions raised to the shininess exponent p.
- What is the Blinn-Phong variant's specular term?It replaces (Ê·R̂)^p with max(0, N̂·Ĥ)^p, where Ĥ is the unit halfway vector between light and viewer.
- How is the halfway vector Ĥ computed in Blinn-Phong?Ĥ = (L̂ + Ê) / ‖L̂ + Ê‖, the normalized sum of the light and view direction vectors.
- How does the shininess exponent p affect the specular highlight?Larger p (e.g., 64, 128) gives a smaller, tighter, sharper highlight (polished surfaces); smaller p gives a broad, dull highlight.
- What is Gouraud shading?Per-vertex lighting: the lighting equation is evaluated in the vertex shader and the resulting vertex color is passed as a varying to the fragment shader.
- What is the main flaw of Gouraud shading?If a specular highlight falls in the interior of a large triangle and misses all three vertices, the highlight disappears entirely.
- What is Phong shading?Per-pixel (per-fragment) lighting: vertex normals and positions are passed as varyings and the lighting equation is evaluated at every pixel in the fragment shader.
- Why must the normal be re-normalized in the fragment shader during Phong shading?Because linear interpolation of unit vectors shortens their length, so normalize(v_normal) restores unit length before lighting.
- What advantage does Phong shading have over Gouraud shading for specular highlights?Phong shading accurately captures tight specular highlights that fall inside triangles, which Gouraud shading can miss entirely.
- What are the four main components summed in the local Phong illumination equation?Emissive, ambient, Lambertian diffuse, and Phong specular terms.
- In the Phong equation, what does the emissive term c_e represent?A constant color the surface emits on its own, independent of lighting.
- What does the ambient term c_a l_a represent in the Phong model?A constant approximation of indirect/global illumination, equal to the ambient color times the ambient light intensity.
- What does the GLSL function step(edge, x) return?It returns 0.0 if x < edge, otherwise 1.0. This hard threshold produces severe staircase aliasing (jaggies).
- Why does step() cause aliasing in procedural shaders?It creates a hard, instantaneous threshold with no transition, so edges appear as jagged staircases rather than smooth boundaries.
- What interpolation does smoothstep(e0, e1, x) use?A Hermite cubic interpolation 3t² − 2t³, where t = clamp((x − e0)/(e1 − e0), 0, 1).
- What does the GLSL mix(a, b, t) function compute?Linear interpolation: (1 − t)a + tb.
- What does fract(x) compute and what is it used for?It returns x − floor(x), producing a repeating 0-to-1 ramp used for periodic tiling like stripes, checkerboards, and polka dots.
- What is mod(x, y) used for in procedural pattern shaders?Periodic tiling of patterns such as stripes, checkerboards, and polka dots.
- How do you anti-alias a procedural edge at x = edge using smoothstep?Replace step(edge, x) with smoothstep(edge − w, edge + w, x), where w is roughly half to one screen pixel in (u,v) parameter space.
- What should the transition width w be when anti-aliasing an edge with smoothstep?Roughly half to one screen pixel, measured in (u,v) parameter space.
- Why can GPUs estimate derivatives like dFdx and dFdy in fragment shaders?Because fragment shaders execute in 2×2 pixel quads, so hardware finite differences can estimate how fast a variable changes per screen pixel.
- What is the formula for fwidth(x)?fwidth(x) = |dFdx(x)| + |dFdy(x)|.
- What do dFdx(x) and dFdy(x) measure?The rate of change of x per screen pixel in the x and y screen directions, estimated via hardware finite differences.
- What is the purpose of fwidth in shader anti-aliasing?It estimates how fast a variable changes per screen pixel, giving the appropriate transition width for smoothstep-based anti-aliasing.
- What is Perlin noise and what visual effects does it produce?A coherent multi-octave gradient noise that generates natural-looking patterns like clouds, terrain, wood, and marble, unlike uncorrelated white noise.
- How is Perlin noise generated on a grid?Each integer grid corner gets a pseudo-random unit gradient vector; dot products between corner gradients and offset vectors to the point are computed and blended with cubic/quintic smoothstep.
- What are octaves in Perlin noise (turbulence/fBm)?Summing multiple noise layers at frequencies 2^k with amplitudes 1/2^k, producing fractal-like detail.
- How does rasterization differ from backward ray tracing?Rasterization is object-centric, projecting triangles onto pixels and struggling with global illumination; backward ray tracing is pixel-centric, casting viewing rays from the eye through each pixel.
- What rays does backward ray tracing recursively spawn after finding the closest surface intersection?Shadow rays toward light sources, specular reflection rays along R, and transmission/refraction rays following Snell's Law.
- What is a BRDF?The Bidirectional Reflectance Distribution Function f_r(ω_i, ω_o), the ratio of outgoing radiance in view direction ω_o to incoming irradiance from direction ω_i.
- How does Monte Carlo path tracing use the BRDF?It samples random rays weighted by the BRDF to estimate lighting.
- What is a texture atlas and why use it?Packing multiple small textures into one large image texture to avoid binding different textures between draw calls.
- What is overdraw in forward rendering?Running expensive fragment lighting on every rasterized fragment, even if a nearer triangle later overwrites it in the Z-buffer.
- What are the two passes of deferred shading?Pass 1 (Geometry Pass) renders geometry with Z-testing into off-screen G-Buffers storing position, normal, albedo, and specular parameters; Pass 2 (Lighting Pass) evaluates multi-light shaders once per visible screen pixel from the G-Buffers.
- What do G-Buffers store in deferred shading?Per-pixel position, normal, albedo, and specular parameters.
- Why is deferred shading more efficient than forward rendering for many lights?It evaluates complex multi-light shaders exactly once per visible screen pixel, avoiding redundant lighting work on overdrawn fragments.
- What blending function is used to combine Perlin gradient contributions?Cubic/quintic smoothstep blending.
- What is the general form of a 2D homogeneous translation matrix?A 3×3 matrix with 1s on the diagonal, tx and ty in the last column, and 0s elsewhere in the bottom row: [[1,0,tx],[0,1,ty],[0,0,1]].
- What is the general form of a 3D homogeneous translation matrix?A 4×4 identity matrix with tx, ty, tz placed in the last column's first three rows.
- What does a 2D homogeneous scaling matrix look like?A 3×3 matrix with sx and sy on the main diagonal, a 1 in the bottom-right corner, and zeros elsewhere.
- What does a 3D homogeneous scaling matrix look like?A 4×4 matrix with sx, sy, sz on the main diagonal, a 1 in the bottom-right corner, and zeros elsewhere.
- What is the 2D homogeneous rotation matrix for angle θ?[[cosθ, −sinθ, 0],[sinθ, cosθ, 0],[0, 0, 1]].
- What is the 3D homogeneous rotation matrix about the Z-axis for angle θ?A 4×4 matrix whose upper-left 2×2 block is [[cosθ, −sinθ],[sinθ, cosθ]], with 1s on the remaining diagonal and zeros elsewhere.
- Why are homogeneous coordinates used for transformations?They allow translation, scaling, and rotation to all be represented as matrix multiplications, so transformations can be composed by multiplying matrices.
- What is the size of a 2D homogeneous transformation matrix?3×3.
- What is the size of a 3D homogeneous transformation matrix?4×4.
- In a homogeneous transformation matrix, where do translation parameters appear?In the last column (the first n entries), with the bottom row typically [0, …, 0, 1].
- In a homogeneous scaling matrix, where do the scale factors appear?On the main diagonal (sx, sy, and sz in 3D), with the final diagonal entry equal to 1.
- What does the bottom row of a standard homogeneous transformation matrix contain?Zeros followed by a 1 (e.g., [0, 0, 1] in 2D or [0, 0, 0, 1] in 3D).
- What is the effect of the sign pattern in a rotation matrix's sine terms?The upper-right sine term is negative and the lower-left sine term is positive, giving counterclockwise rotation by θ.
- How many translation degrees of freedom does a 3D homogeneous translation matrix have?Three: tx, ty, and tz.
- How many scale factors does a 3D homogeneous scaling matrix have?Three: sx, sy, and sz, one per axis.
- Which curve family interpolates all of its control points but suffers from Runge oscillation and has no local control?The Lagrange polynomial (degree n) interpolates all n+1 points, is C-infinity, but is global (no local control) and exhibits Runge oscillation.
- What continuity does a cubic Hermite spline have at its joints, and what condition is required?C(1) continuity, provided the tangent vectors p' are shared between adjacent segments.
- Which control points does a degree-n Bézier curve interpolate?Only the endpoints p_0 and p_n; the interior control points are approximated, not interpolated.
- Does a Bézier curve satisfy the convex hull property, and what is its default joint continuity?Yes, it satisfies the convex hull property. Default continuity at joints is C(0), improving to C(1) if the control-point differences (Δp) match.
- What is the derivative formula at the start of a degree-n Bézier curve?p'_0 = n(p_1 − p_0).
- Which spline interpolates all interior control points and has C(1) (but not C(2)) continuity?The Cardinal / Catmull-Rom spline, which uses 4 points per span and gives local control.
- In a Cardinal spline, how are the tangents computed, and what value of s gives Catmull-Rom?p'_i = s(p_{i+1} − p_{i-1}); Catmull-Rom uses s = 1/2.
- Does a uniform quadratic B-spline (Chaikin) interpolate its control points, and what are its continuity and hull properties?No, it does not interpolate control points. It is C(1), satisfies the convex hull property, and has local control using 3 points per span.
- What continuity does a uniform cubic B-spline have at its joints?C(2) continuity, with local control using 4 points per span and the convex hull property.
- What is the general continuity of a degree-n B-spline at its joints?C(n−1) continuity (for n ≥ 2), and it does not interpolate control points.
- Which curve families satisfy the convex hull property?Bézier curves, uniform quadratic B-splines, uniform cubic B-splines, and general degree-n B-splines all satisfy the convex hull property.
- Which curve families provide local control?Cubic Hermite, Bézier (per-segment), Cardinal/Catmull-Rom, and all B-spline families provide local control; Lagrange does not.
- Which curve families interpolate all of their control points?Lagrange polynomials and Cardinal/Catmull-Rom splines interpolate all control points; Bézier and Hermite interpolate only endpoints.
- What basis/conversion formula describes a cubic Hermite segment?(2u³−3u²+1)p_0 + (u³−2u²+u)p'_0 + (−2u³+3u²)p_1 + (u³−u²)p'_1.
- How many control points per span do uniform quadratic and uniform cubic B-splines use?Uniform quadratic B-splines use 3 points per span; uniform cubic B-splines use 4 points per span.
- In Canvas 2D, which direction does the +y axis point, and how does that affect the apparent direction of context.rotate(Math.PI / 4)?Canvas +y points down, so a positive rotation appears clockwise on screen (opposite to standard Cartesian math where +y is up and positive rotation is counterclockwise).
- What does context.scale(-1, 1) do to the coordinate system, and how does it affect subsequent rotate() calls?It flips the X-axis (a reflection with determinant -1, so non-rigid), which also reverses the apparent direction of subsequent rotate() calls.
- Given context.transform(a, b, c, d, e, f), where does the origin (0,0) map to?The origin maps to (e, f).
- Given context.transform(a, b, c, d, e, f), how do you compute a and b from where the point (1,0) lands?If (1,0) maps to (x, y), then a = x - e and b = y - f.
- Given context.transform(a, b, c, d, e, f), how do you compute c and d from where the point (0,1) lands?If (0,1) maps to (x, y), then c = x - e and d = y - f.
- For two cubic Bézier curves (A,B,C,D) and (E,F,G,H), what condition gives C(0) / G(0) continuity?Requires D = E, i.e., the first curve's endpoint equals the second curve's start point.
- What quaternion represents a 90° (π/2) rotation around the Y-axis (0,1,0)?q = (cos 45°, 0, sin 45°, 0) = (√2/2, 0, √2/2, 0), since the half-angle is 45°.
- What quaternion represents a 180° (π) rotation around a unit axis (vx, vy, vz)?q = (0, vx, vy, vz), because the half-angle is 90° so the scalar part is cos 90° = 0.
- What quaternion represents an identity rotation?q = (1, 0, 0, 0), or equivalently (-1, 0, 0, 0).
- Do normal maps or bump maps change a mesh's vertex positions or silhouette?No; they only affect shading. A sphere with a brick normal map still has a perfectly circular silhouette.
- What type of map must be applied in the vertex shader to actually alter a mesh's geometry?A displacement map.
Velocer 免费:间隔重复,还能从任何文档创建你自己的卡片。
PDF to flashcards · Lecture to flashcards · Practice exam · Syllabus study plan · Anki import
University of Wisconsin–Madison 的更多牌组
- comp sci 240 midterm 1
- comp sci 240 midterm 2
- COMP SCI 240 Midterm 3
- COMP SCI 240 Final
- comp sci 300 full course review
- CS 639: Introduction to Reinforcement Learning · UW-Madison
- CS 839: Reinforcement Learning · UW-Madison
- CS 544: Intro to Big Data Systems · UW-Madison
- CS 580: Intelligent Robotics · UW-Madison
- CS 784: Foundations of Data Management · UW-Madison
- CS 880: Quantum Algorithms · UW-Madison
- CS 765: Data Visualization · UW-Madison