= Final Project Writeup = '''Group Members:''' Curtis Andrus[[BR]] == Goals ==[[BR]] The goal of my project was to produce realistic images of watermelons. The original proposal can be found here: CurtisAndrus/FinalProjectProposal.[[BR]] == Techniques Implemented ==[[BR]] The scattering of light within the watermelon was simulated using volumetric photon mapping, and the structure of the watermelon was simulated using a cellular texture function.[[BR]] === Volumetric Photon Mapping ===[[BR]] Simulation of single-scattering light in the watermelon was done using standard volume rendering (already implemented in PBRT). Multiple scattering was done using photon mapping, by tracing photons through the volume and storing them in a volumetric photon map.[[BR]] Movement of the photons in the volume is determined using ray marching. At each point `p` encountered in the ray marching process, the probability that the photon will interact with the volume at `p` is given by `1 - exp(-int(sigma_t(x),x = p0->p))`, where `p0` is the point where the photon entered the volume [1]. If a photon leaves the watermelon without interacting with the volume it is not stored in the photon map. If it does interact, `sigma_s(p)/sigma_t(p)` is the probability that the photon will scattered at point `p`. If it is scattered a new direction is computed by importance sampling the phase function. Also, the radiance of the scattered photon is scaled by the scattering probability. If the photon is not scattered, it is absorbed and stored in the photon map.[[BR]] The watermelon is rendered using ray-marching to compute the single-scattering term. At each point, the multiple scattering contribution is computed by adding of the radiances of each photon. This formula for this is given by the following equation:[[BR]] `step_size * Sum(phase(x,w,,p,,w)*photon_radiance/((4/3)*pi*r^3), p=1->N)`[[BR]] Where `phase()` is the phase function of the volume, and `r` is the radius of the sphere in which the photons are located [2].[[BR]] I implemented the photon mapping by adding a volumetric map to pbrt's photon map integrator. If a photon hits a surface with a volume, it is then traced through the volume and stored in a separate map using the method described. I estimate of the volume radiance is computed by adding the term to the value computed by pbrt's single scattering volume integrator.[[BR]] '''Photon Mapping Test Images:'''[[BR]] attachment:photontest1.jpg A test of the watermelon model, using a Perlin noise as the density function.[[BR]] attachment:backlit1.jpg attachment:backlit2.jpg