A Room

I do not know how to use 3D modeling tools, so I searched on Google to find a scene that would utilize the models I already have in obj format.

I want to do photon mapping to render diffuse and caustic.

The reason why I want to do photon mapping is because Jensen said that
games are moving towards using small photon maps to add a little bit
of global illumination, so I might as well do it now.

I got Jensen's realistic image synthesis using photon mapping to use
to learn more about it.

To make the scene more artistic/creative, I will add the following effects:

Bloom - simply for the creative/artistic part.
http://msdn.microsoft.com/en-us/library/ee417769(VS.85).aspx

Distributed Ray Tracing - Multi-Jittered sampling with Mitchell Filter
reconstruction to make image pretty
The Antialiasing Problem in Ray Tracing
http://www.mentallandscape.com/Papers_siggraph90tutorial.pdf

Tonemapping - To display higher range of colors for artistic/creative.
http://mynameismjp.wordpress.com/2010/04/30/a-closer-look-at-tone-mapping/

Procedural and/or normal bump maps & marble texture - again
artistic/creative aspect
http://www.cs.utk.edu/~huangj/CS594F08/Procedural.ppt
http://www.terathon.com/code/tangent.html
http://www.netsoc.tcd.ie/~nash/tangent_note/tangent_note.html
http://en.wikipedia.org/wiki/Fractional_Brownian_motion

Textures, reflection, refraction, soft shadows from previous
assignments will be included if scene fits.

Obviously this scene is too boring, so I added the following to mix it up:

Multi-Jittered Sampling

To produce some samples, one way is to generate random numbers in [0,1]. That would lead to oversampled and undersampled regions. Stratified sampling improves the random numbers by limiting the range from which each sample is drawn. Take a pixel and subdivide it into smaller grids preferably the grid by n by n size. This would yield better results, but clumping could still occur between cells. Multi-Jittered simply enforces an N-rooks constraint on the samples. This prevents any two samples from being in the same row or column of the subgrid.

Mitchell Filter

To get a final pixel color, the multiple samples per pixel can be averaged together. This will make the image blurry, so fine detail is lost. The Mitchell filter is closest to an ideal filter that will not blur the image. It simply assigns a weight to each sample in the pixel and around the pixel based on the distance from the center of the pixel to the sample. The filter is a separable two-parameter family of cubic filters, so the weight is computed by multiplying the weight along the x and y axis. (left is average of samples in a pixel, right is using the Mitchell filter)

Procedural marble texture

The table of the reference image looked so boring, so I decided to replace that with a marble texture instead. To generate the marble, I used a gradient of some color I chose randomly and Fractional Brownian motion. I was going to see which generated cooler looking marble: turbulence or fractal sum. The latter looked better, so I picked that. It turns out that fBm is the generalized version of fractal sum. To use the gradient, I chose sin(y + noise) to cycle through the gradient ramp.

Procedural Bump Mapping & Normal Mapping with Texturing

The normal map I got online had a texture that came along with it, so I added UV texture coordinates. That helped generate the tangents/bitangents of each vertex in a mesh. To do that, find the tangents/bitangents for each triangle face. Then average all the tangents/bitangents that share the vertex. For procedural bump mapping, I simply used those vectors as pu and pv. For normal mapping, I read the Tangent Space normal from a normal map and brought that into World Space using the TBN matrix.

Tone Mapping

The marble image and the normal map image has really bright white colors that would hide the details in those areas because a simple clamping tone mapping operator was used. I switched that out with Reinhard's log-avg luminance operator. Scale and compress the luminance of each pixel and multiply the original RGB did not yield a good result, so the pixel colors were brought into XYZ and xyY color space, scaled and converted back.

Bloom, Glossy Reflection, and Depth of Field

To complete the artistic requirements, these techniques were used.

Global Illumination & Spherical Soft Shadows

Progression towards final image.

Final Image

The left and right wall are simply textured using UV coordinates. The back wall is normal mapped. The floor is a procedural bump map using the values I got from Worley. The ceiling is using glossy reflection. The table use a procedural marble texture based on a generalized form of fractal sum. The whole scene was tone mapped and bloomed to get a more artistic feel. The soft shadows was generated using an spherical area light. The small amount of indirect light under the table was done with an indirect photon map. The small caustic to the left of the bunny is done using a caustic photon map. A depth of field was added to make it more realistic. However, this image only uses 4 multijittered samples per pixel combined with Mitchell filtering, so the depth of field is especially noisy.