Computer Graphics Exam Notes

Motion Capture

  • Motion capture aims to capture the motion of a model from a real-life actor.
  • Procedure:
    • Place markers on the actor’s body, typically at joints, to record motion in real time.
    • Track markers using multiple calibrated cameras.
    • Estimate joint positions using triangulation.

Rendering Pipeline in 3D Graphics

  • Stages: modeling, transformation, lighting, rasterization, and pixel shading.
  • Process: Transforms 3D objects into a 2D image by:
    • Projecting vertices onto the screen.
    • Applying lighting and shading calculations.
    • Rasterizing the result into pixels for display.

Alpha Channel in Texture Mapping

  • Represents transparency.
  • Allows textures to have varying levels of opacity.
  • Enables rendering of transparent objects like glass, while maintaining realistic interactions with other objects.

MIP Mapping in OpenGL

  • Improves texture rendering by creating a series of prefiltered texture images at different resolutions.
  • Advantages:
    • Better texture quality at varying distances.
    • Enhanced performance.
    • Prevention of texture popping artifacts.
  • Particularly useful in real-time graphics and scenarios where consistent texture quality across distances is critical for a visually pleasing and efficient rendering process.

Global Illumination

  • Simulates how light interacts with surfaces and scatters throughout a scene, considering specular and diffuse lighting.
  • Differs from local illumination models, which do not consider object-to-object interactions.
  • Examples: ray tracing, path tracing, and radiosity.

Rendering Capabilities Characterization

  • Gouraud shading: L[DS]EL[D|S]E (single diffuse or specular reflection).
  • Phong shading: L[DS]EL[D|S]E (single diffuse or specular reflection).
  • Ray tracing: LDSELDS^*E (single diffuse but multiple specular reflections).
  • Radiosity method: LDELD^*E (multiple diffuse reflections).

Primary Uses of Normals in Computer Graphics

  • Lighting Calculations: Normals determine how light interacts with a surface, affecting its brightness and shading.
    • Different lighting models use normals to compute diffuse and specular reflections accurately.
  • Bump Mapping and Displacement Mapping: Normals are employed to simulate fine surface details without altering the geometry.
    • By perturbing normals, these techniques create the illusion of bumps and deformations.
  • Surface Smoothing: Normals play a role in creating smooth surfaces.
    • In techniques like Gouraud and Phong shading, normals are interpolated across vertices to create the illusion of smooth shading.

Rendering Methods and Caustic Effects on Velvet

  • Scene: A gemstone placed on a velvet cushion with a light source.
  • Caustic Effects: Consider the area where strong caustics would appear in the real world.
    • Phong Model
      • Only considers local geometry and the direction of incoming light.
      • Estimates a reflection intensity not affected by the gemstone.
      • The colors of the velvet surface are represented without any shadows or caustics.
    • Whitted Ray Tracing
      • Approximates the velvet surface as an ideal diffuse surface.
      • Backward tracing of the corresponding ray stops at the surface.
      • A shadow ray (aka light ray) is created from this point to the light source.
      • The gemstone occludes the path of this shadow ray, classifying the point as being in the shadow.
      • The highlighted area is rendered as being completely in the shadow, without any caustics.
    • Path Tracing
      • For every pixel on the cushion surface, many rays are shot, each following a random walk.
      • Some rays are refracted within the gemstone, hitting the light source in bright caustic regions.
      • Aggregating the contributions of all random rays simulates complex interactions between light and objects realistically.
      • The illumination on the cushion surface is very realistic and includes the caustics.

Calculation of Specular Highlight Peak

  • Given:
    • Directional light source at direction (3,1,6)(3, 1, 6).
    • Reflective ground plane at x=4x = 4.
    • Camera at location (b,4,d)(b, 4, d).
    • Specular highlight peak at the point (4,2,6)(4, 2, 6).
  • Reflection direction: r=(3,1,6)r = (3, -1, -6)
    • Defined by r=2(nL)nLr = 2(n \cdot L)n - L, where LL is the light direction and nn is the normal vector.
  • Ray from the reflection point to the eye: (4,2,6)=(b,4,d)+t(3,1,6)(4, 2, 6) = (b, 4, d) + t(3, -1, -6)
  • Solve for tt using the y coordinate: t=2t = 2.
  • Substitute tt to find bb and dd:
    • b=2b = -2
    • d=18d = 18

Matrix Transformation Sequence

  • Transform shape MM into shape NN.
  • Origin is located at the center of shape MM.
  • Steps:
    • Scale shape MM by 2 in the y direction.
    • Rotate it by 45 degrees around the z-axis.
    • Translate with the vector (+2,2,0)(+2, -2, 0).
  • The transformation matrix applied to shape MM is:
    [1002 0102 0010 0001]\begin{bmatrix} 1 & 0 & 0 & 2\ 0 & 1 & 0 & -2\ 0 & 0 & 1 & 0\ 0 & 0 & 0 & 1 \end{bmatrix}
    [121200 121200 0010 0001]\begin{bmatrix} \frac{\sqrt{1}}{2} & - \frac{\sqrt{1}}{2} & 0 & 0\ \frac{\sqrt{1}}{2} & \frac{\sqrt{1}}{2} & 0 & 0\ 0 & 0 & 1 & 0\ 0 & 0 & 0 & 1 \end{bmatrix}
    [1000 0200 0010 0001]\begin{bmatrix} 1 & 0 & 0 & 0\ 0 & 2 & 0 & 0\ 0 & 0 & 1 & 0\ 0 & 0 & 0 & 1 \end{bmatrix}

Z-buffer Algorithm

  • Handles occlusions by recording the depth of each rendered pixel and overwriting it if a new, closer surface is rendered on the same location.
  • Steps (with alpha = 1):
    1. Render the yellow bar.
    2. Render the green bar.
    3. Render the red bar.

Algorithm Choice for Translucency

  • If alpha=0.4alpha = 0.4, Painters is a better choice than Z-buffer.
  • Reason:
    • Z-buffer cannot easily handle translucency as it requires storing multiple depths in the depth buffer.
    • Painters can render the yellow bar by blending the pixel’s color with the previous color using the appropriate alpha instead of overwriting it.