Computer Graphics Exam Notes
Motion Capture
- Definition: Capturing the motion of a model from a real-life actor.
- Procedure:
- Placing markers on the actor’s body, typically at joints, to record motion in real time.
- Tracking markers using multiple calibrated cameras.
- Estimating 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, and rasterizing the result into pixels for display.
Alpha Channel in Texture Mapping
- Significance: Represents transparency.
- Function: Allows textures to have varying levels of opacity.
- Use Case: Enables rendering of transparent objects like glass, while maintaining realistic interactions with other objects.
MIP Mapping in OpenGL
- Improvement: 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.
- Usefulness: 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
- Definition: Simulates how light interacts with surfaces and scatters throughout a scene, considering specular and diffuse lighting.
- Difference from Local Illumination: Global illumination considers object-to-object interactions, while local illumination models do not.
- Examples: Ray tracing, path tracing, and radiosity.
Rendering Capabilities Characterization
The symbols L, E, D, and S are used to characterize the capabilities of rendering algorithms. The notations are as follows:
- Gouraud shading: (single diffuse or specular reflection).
- Phong shading: (single diffuse or specular reflection).
- Ray tracing: (single diffuse but multiple specular reflections).
- Radiosity method: (multiple diffuse reflections).
Primary Uses of Normals in Computer Graphics
- Lighting Calculations
- Function: Normals determine how light interacts with a surface, affecting its brightness and shading.
- Application: Different lighting models use normals to compute diffuse and specular reflections accurately.
- Bump Mapping and Displacement Mapping
- Function: Normals are employed to simulate fine surface details without altering the geometry.
- Process: By perturbing normals, these techniques create the illusion of bumps and deformations.
- Surface Smoothing
- Function: Normals play a role in creating smooth surfaces.
- Application: In techniques like Gouraud and Phong shading, normals are interpolated across vertices to create the illusion of smooth shading.
Rendering Methods and Caustic Effects
Consider a scene with a gemstone on a velvet cushion and a light source. The gemstone refracts light, creating caustic patterns on the velvet. How the following rendering methods would represent the caustic effects:
- Phong Model:
- Takes into account the local geometry and the direction of incoming light.
- Estimates a reflection intensity not affected by the gemstone's presence.
- The velvet surface's colors are represented without shadows or caustics.
- Ray Tracing (Whitted):
- The velvet surface is approximated as an ideal diffuse surface.
- Backward tracing of the corresponding ray stops at the surface.
- A shadow ray from the point to the light source is created.
- If the gemstone occludes the path of the shadow ray, the point is classified as being in the shadow, rendering the highlighted area as completely shadowed without caustics.
- Path Tracing:
- Many rays are shot for every pixel on the cushion surface, each following a random walk.
- Some rays are refracted within the gemstone and hit the light source in bright caustic regions.
- Aggregating the contributions of all random rays simulates complex interactions between light and objects realistically, including caustics.
Specular Highlight Peak Calculation
Given a directional light source at direction , a reflective ground plane at , and a camera at , calculate and for the specular highlight peak at .
- The reflection direction r is , defined by , where is the light direction and is the normal vector.
- Consider the ray from the reflection point to the eye: .
- Use the y coordinate to solve for : .
- Substitute :
Transformation Matrix Sequence
Transform shape M into shape N with the following sequence of matrices:
- Scale shape M by 2 in the y direction.
- Rotate it by 45 degrees around the z-axis.
- Translate it with the vector .
The matrix applied to shape M is then:
\begin{bmatrix}
1 & 0 & 0 & 2 \
0 & 1 & 0 & -2 \
0 & 0 & 1 & 0 \
0 & 0 & 0 & 1
\end{bmatrix} \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} \begin{bmatrix}
1 & 0 & 0 & 0 \
0 & 2 & 0 & 0 \
0 & 0 & 1 & 0 \
0 & 0 & 0 & 1
\end{bmatrix}
Z-Buffer Algorithm and Translucency
Scenario: Camera facing bars, yellow bar is translucent with alpha value defining opacity.
(a) Z-Buffer with alpha = 1:
The Z-buffer handles occlusions by recording the depth of each rendered pixel and overwriting it if a closer surface is rendered on the same location.
- Render the yellow bar.
- Render the green bar.
- Render the red bar.
(b) Algorithm Choice with alpha = 0.4:
- Better Choice: Painters algorithm.
- Reason: Z-buffer cannot easily deal with translucency as it requires storing multiple depths in the depth buffer, while Painters can render the yellow bar by blending the pixel's color with the previous color using the appropriate alpha instead of overwriting it.