Week 12 Tutorial Solutions

Question 1: Radiosity

Consider the 3x3 room below.

We want to use radiosity to light this room. We shall consider each wall to be made of three equal size patches. For the sake of this exercise we will work in 2D only.

We can use the Nusselt Analog to compute the form factors between patches:

The image above illustrates the computation for F[8,5], below

tan(theta) = 1/1.5
theta = 33.69°
cos(theta) = 0.83

tan(phi) = 2/1.5
phi = 53.13°
cos(phi) = 0.6

F[8,5] = (cos(theta) - cos(phi)) / 2
       = 0.12

a) What are the form factors for the other faces. (Hint: you can exploit a lot of symmetry here)

We need only compute form factors for walls 7 and 8. All the others can be obtained by symmetry.

As shown in the example F(i,j) equals (cos(theta) - cos(phi)) / 2.

We can compute these cosines from the dimensions of the image. For wall 8:

The rest can be computed by symmetry.

This provides form factors:

Similarly for wall 7:

Suppose the window (patch 2) has emmissive energy E[2] = 1 and diffuse reflection coefficient rho[2] = 0
All the other walls have E[i] = 0 and rho[i] = 0.5.

b)Use four iterations of the progressive refinement algorithm to compute radiosity values for the walls.

The progressive refinement algorithm is shown below. It prioritises patches by how much light they have stored up.

for each patch i:
    B[i] = dB[i] = E[i]

iterate:
  select patch i with max dB[i]:
  calculate F[i][j] for all j
  for each patch j:
    dRad = rho[j] * B[i] *
           F[i][j] * A[j] / A[i]
    B[j] += dRad
    dB[j] += dRad
    dB[i] = 0
Note:Nusselt's Analog computes the form factor Fij for light entering the patch i from every patch j.

To compute the form factor Fji for light sent from patch i to patch j, we use the equation

Fji = Fij Aj/Ai
Now the table below summarises the application of four iterations of the progressive refinement algorithm. The bold entry in each dB column indicates the patch with the maximum amount of stored energy (walls 2, 8, 7, 9), which is spread in the next iteration.

The red values in interactions 2, 3 and 4 show the walls which have significant radiosity change as a result. In this example the effects are relatively small, because the initial light source isn't very bright.

Question 2: Rational Bezier Splines

Evaluate the co-ordinates of a unit circle, with the centre at (0,0) defined by the parametric equation for a circle

x(theta) = cos theta
y(theta) = sin theta

with theta = 90 and theta = 210

Show how a degree 2 rational Bezier spline with the control points and weights in the table below can represent a unit circle at centre (0,0).

Evaluate the co-ordinates of the circle at theta 90 and 210 by using equivalent values of t and the relevant rational bezier spline equations.

Control point Weight
(0, -1) 1
(-sqrt(3), -1) 0.5
(-sqrt(3)/2, 1/2) 1
(0, 2) 0.5
(sqrt(3), 1/2) 1
(sqrt(3), -1) 0.5
(0,-1) 1
Evaluating
x(theta) = cos theta
y(theta) = sin theta
with The spline consists of three curves each forming a third of the circle.

Each are degree 2 rational bezier curve with equation:

The equivalent point at theta = 90 would be t = 0.5 on the curve with control points

P0: (sqrt(3)/2, 1/2) P1: (0,2) P2: (-sqrt(3)/2,1/2)
Substituting those values into the equation above should give us P = (0,1)

The equivalent point at theta = 210 would be t = 0.5 on the curve with control points

P0: (-sqrt(3)/2, 1/2) P1: (-sqrt(3),-1) P2: (0,1)
Substituting those values into the equation above should give us P = (-8.66,-0.5)

Question 3: Sample Exam Questions

a and b are similar in style to Part B of the final exam which are short answer questions. c,d,e and are similar in style to Part C in the final exam which are design questions

  1. Explain the advantages and disadvantages of normal mapping (a.k.a. bump mapping) over adding extra polygons to represent detail.
  2. We have looked at three methods for simulating shadows: shadow mapping, ray-tracing and radiosity. What are the pros and cons of each technique? When might they be appropriate to employ?
  3. Below is an image of M. C. Escher's Three Worlds. We want to render a short animation of this scene. What techniques would we employ?
  4. Note: This is a much longer answer than I would expect from you in the exam. I provide it here to show the variety of things to think about in rendering a simple image like this. If this were an exam question, it would focus more on the particular use of ray-tracing to render this scene.
  5. For an art project you need to render a polished wooden bowl like the one below. How would you generate this mesh? What method would you use to texture it? What would its material properties be for lighting?

    • A mesh for this shape could fairly easily be extruded by taking a vertical cross section through the middle of the bowl and rotating it around the Y-axis (creating a surface of revolution). To create the effect of the bowl having been carved out of a solid piece of wood, it would be more appropriate to use a 3D texture of woodgrain rather than try to wrap a 2D texture around this surface.
    • The bowl shows both specular and diffuse illumination (notice the specular highlights on the rim and inside the bowl). The specular highlights are broad, suggesting a low shininess value would be appropriate. Phong shading would probably be appropriate to ensure that the surface appears curved and highlights are rendered well. A normal map could be added to give the surface some roughness so that it doesn't look too glossy.
  6. You want to implement a smoky fire in a 3D game. Name (at least) two different approaches to implementing this. What are the pros and cons of each?

If there is any more time left, please go over material from previous weeks tutorials that were not finished or discuss last minute assignment issues.