Computer Graphics Notes

Motion Capture

  • Motion capture aims at capturing the motion of a model from a real-life actor.
  • This is usually done by placing markers on the actor’s body, typically at joints, to record their motion in real time.
  • The markers are usually tracked using multiple calibrated cameras, and the joint position is estimated using triangulation.

Rendering Pipeline in 3D Graphics

  • The rendering pipeline includes stages like modelling, transformation, lighting, rasterisation, and pixel shading.
  • It transforms 3D objects into a 2D image by projecting vertices onto the screen, applying lighting and shading calculations, and rasterising the result into pixels for display.

Alpha Channel in Texture Mapping

  • The alpha channel in texture maps represents transparency.
  • It allows textures to have varying levels of opacity, enabling the rendering of transparent objects like glass, while maintaining realistic interactions with other objects.

MIP Mapping in OpenGL

  • 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.
  • 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.

Global Illumination

  • Global illumination in computer graphics simulates how light interacts with surfaces and scatters throughout a scene, considering specular and diffuse lighting.
  • It differs from local illumination models, which do not consider object-to-object interactions.
  • Examples of global illumination techniques include ray tracing, path tracing, and radiosity.

Rendering Capabilities

The symbols L, E, D, and S may be used to characterize the capabilities of rendering:

  • 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 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.

Rendering Methods and Caustic Effects

Consider a scene with a gemstone on a velvet cushion and a light source. Explain how the following rendering methods would represent the caustic effects on the velvet surface:

  • Phong model: The Phong model only takes into account the local geometry and the direction of incoming light. It would estimate a reflection intensity unaffected by the gemstone, and the velvet surface would be rendered without any shadows or caustics.
  • Whitted ray tracing: Since the velvet surface is approximated as an ideal diffuse surface, for any point on the surface, the backward tracing of the corresponding ray would stop there. A shadow ray from this point to the light source would be created. Because the gemstone occludes the path of this shadow ray, the point would be classified as being in the shadow, rendering the highlighted area as completely in the shadow without any caustics.
  • Path tracing: For every pixel on the cushion surface, many rays would be shot, each following a random walk. Some rays would be refracted within the gemstone, and for the bright regions of the caustics, would eventually hit the light source. Aggregating the contributions of all random rays, path tracing would simulate the complex interactions between the light and the objects in the scene realistically, including the caustics.

Specular Highlight Peak Calculation

Consider a scene with a directional light source and a reflective ground plane at x=4x = 4. If the light source is positioned at direction (3,1,6)(3, 1, 6) and the camera is at the location (b,4,d)(b, 4, d), calculate the values of bb and dd for which the specular highlight peak appears at the point (4,2,6)(4, 2, 6).

The reflection direction rr is (3,1,6)(3, -1, -6). This is defined by r=2(nL)nLr = 2(n \cdot L)n - L, where LL is the light direction and nn is the normal vector.

First, consider the 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)

Use the y coordinate to solve for tt:

t=2t = 2

Substituting gives:

b=2b = -2

d=18d = 18

Transforming Shape

From the figure, the origin is located at the centre of shape M. First, scale shape M with two in y direction. Then, rotate it for 45 degrees around the z-axis. Finally, translate with the vector (+2,-2,0). The matrix applied to shape M is then:

[1amp;0amp;0amp;2 0amp;1amp;0amp;2 0amp;0amp;1amp;0 0amp;0amp;0amp;1]\begin{bmatrix} 1 & 0 & 0 & 2\ 0 & 1 & 0 & -2\ 0 & 0 & 1 & 0\ 0 & 0 & 0 & 1 \end{bmatrix}

[12amp;12amp;0amp;0 12amp;12amp;0amp;0 0amp;0amp;1amp;0 0amp;0amp;0amp;1]\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}

[1amp;0amp;0amp;0 0amp;2amp;0amp;0 0amp;0amp;1amp;0 0amp;0amp;0amp;1]\begin{bmatrix} 1 & 0 & 0 & 0\ 0 & 2 & 0 & 0\ 0 & 0 & 1 & 0\ 0 & 0 & 0 & 1 \end{bmatrix}

Z-buffer Algorithm

(a) Explain how the Z-buffer algorithm would render this scene if 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

  1. Render the yellow bar.
  2. Render the green bar.
  3. Render the red bar

(b) If alpha = 0.4, explain which algorithm is a better choice to render this scene, Z-buffer or Painters and why.

Painters, Z-buffer cannot deal with translucency easily as it requires to store multiple depths in the depth buffer.

While Painters can render the yellow bar by blending the pixel’s colour with the previous colour using the appropriate alpha instead of overwriting it.