Computer Graphics Exam Notes
Question 1
(a) Motion Capture
- Motion capture is the process of capturing the movement of a model from a real-life actor.
- Procedure:
- Markers are placed on the actor's body, typically at joints, to record their motion in real-time.
- Multiple calibrated cameras track the markers.
- The joint position is estimated using triangulation.
(b) Rendering Pipeline in 3D Graphics
- The rendering pipeline transforms a 3D scene into a 2D image.
- Stages:
- Modeling
- Transformation
- Lighting
- Rasterization
- Pixel shading
- Process:
- 3D objects are transformed by projecting vertices onto the screen.
- Lighting and shading calculations are applied.
- The result is rasterized into pixels for display.
(c) Significance of Alpha Channel in Texture Mapping
- The alpha channel in texture maps represents transparency.
- It allows textures to have varying levels of opacity.
- This enables the rendering of transparent objects, such as glass, while maintaining realistic interactions with other objects.
(d) MIP Mapping in OpenGL
- MIP mapping 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:
- MIP mapping is particularly useful in real-time graphics and scenarios where consistent texture quality across distances is critical for a visually pleasing and efficient rendering process.
(e) Principles of Global Illumination
- Global illumination simulates how light interacts with surfaces and scatters throughout a scene.
- It considers both specular and diffuse lighting.
- Difference from local illumination: Local illumination models do not consider object-to-object interactions.
- Examples of global illumination techniques:
- Ray tracing
- Path tracing
- Radiosity
(f) Symbols for Rendering Capabilities
The symbols L, E, D, and S can be used to characterize the capabilities of rendering algorithms:
- 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).
(g) Primary Uses of Normals in Computer Graphics
- Normals in computer graphics are used for:
- 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 in bump mapping and displacement mapping 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.
Question 2
Caustic Effects Representation
Consider a scene with a gemstone on a velvet cushion and a light source.
- Phong model: The Phong model only considers local geometry and incoming light direction. It would estimate a reflection intensity that is not affected by the gemstone, and the velvet surface would be rendered without shadows or caustics.
- Ray tracing: For any point on the velvet, backward tracing stops. A shadow ray is created from the point to the light source. If the gemstone occludes the path, the point is classified as being in shadow and the area is rendered as completely in shadow, without any caustics.
- Path tracing: Multiple rays are shot for every pixel, following a random walk. Some rays are refracted within the gemstone and hit the light source. Aggregating the contributions of all random rays, path tracing simulates complex light interactions realistically, including caustics.
Question 3
Specular Highlight Calculation
- Given:
- Directional light source at (3, 1, 6).
- Camera at (b, 4, d).
- Reflective ground plane at x = 4.
- Specular highlight peak at point (4, 2, 6).
- Reflection direction r = 2(n cdot L)n - L, where L is the light direction and n is the normal vector.
- The reflection direction r is (3, −1, −6).
- Ray from reflection point to the eye:
- Solving for t using the y-coordinate: .
- Substituting t gives: and .
Question 4
Transformation Matrices Sequence
Shape M is transformed into shape N.
Scaling: Scale shape M by 2 in the y-direction.
Rotation: Rotate by 45 degrees around the z-axis.
Translation: Translate with the vector (+2, -2, 0).
- The final matrix applied to shape M is the product of these matrices.
Question 5
(a) Z-buffer Algorithm with Alpha = 1
The Z-buffer handles occlusions by recording the depth of each rendered pixel and overwriting it if a new, 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
- If alpha = 0.4, the Painters algorithm is a better choice than the Z-buffer.
- Z-buffer cannot easily deal with translucency as it requires storing multiple depths in the depth buffer.
- Painters algorithm can render the yellow bar by blending the pixel's color with the previous color using the appropriate alpha instead of overwriting it. That is, it renders from farthest to closest to the camera, allowing proper blending.