Scene File Inputs
.obj with emissive atribute in
.mtl fileDiffusive Material: any material which is not any of the above and have non-zero diffusive coefficient
Parameter in the Program (pathTracer.h)
Figure 1: The Cornell Box rendering at 1000 spp, Russian Roulette with 95% probability with indirect lighting and no other optimization. One can see that the diffuse effect and the color bleeding is functional.
The figure below shows the CornellBox illuminated with direct lighting only, direct lighting global illumination, and indirect lighting.
Figure 2: The CornellBox with 1000 spp and uniform hemisphere sampling. (The direct lighting only is brighter due to the tone mapping)
The figure below show the rendering of variation of Cornell Boxes with different material. Although the sample per pixel is the same, we can see that the quality of the image differs in each case, this can be resolved to some extend with the importance sampling.
Figure 3: The direct lighting global illumination of diffuse material, mirror material, glossy material, and refraction material. respectively. 1000 spp is used for each image.
Figure 4: (left) Cornell Box with 1000spp and unifrom sampling. (right)The same scene with the left but with importance sampling.
Figure 5: (left)Glossy-specular Cornell Box with 1000spp and unifrom sampling. (right)The same scene with the left but with importance sampling.
Figure 6: (left) Mirror Cornell Box with 1000spp and unifrom sampling. (right)The same scene with the left but with importance sampling.
Figure 7: (left) Refractive Cornell Box with 1000spp and unifrom sampling. (right)The same scene with the left but with importance sampling.
(Apparently this doesn't really improve the image quality that much.)
Figure 8: (left)Glossy-specular Cornell Box with 1000spp and importance sampling. (right)The same scene with the left but with stratified sampling with 100 subpixels.
In this case, we consider the combination of the diffuse and specular material. One can see that the noise on
the box is greatly reduced. (This is the same .obj file with CornellBox-Gloosy but taking diffusive
coefficient into the consideration.)
Figure 9: (left)Glossy-specular with diffuse coefficient Cornell Box with 1000spp and importance sampling. (right)The same scene with the left but with multiple importance sampling
Implementation detail:
util/helper.cpp : This files contain a helper function.
uniformSampleHemisphere: uniform sampling a point in the surface of the unit hemisphere where the axis of the hemisphere is pointing toward a vector n.
cosineSampleHemisphere: Sample the light with cosine probability this is used as an importance sampling for the diffuse material
glossySampleHemisphere: importance sampling for the glossy-specular material
pathtracer.cpp :
file and the pathtracer.cpp file. Currently, util/helper.cpp deal with the helper
function that doesn't take in the detail about the path tracing such as the random