Thursday, 10 February 2011

My implementation

Ok my initial implementation of the wetness paper is as follows.  I am just doing the subsurface part first.
In my hand i have a progressive photon map implementation. This implementation has ray tracing pass first which generate hit points on diffuse surfaces. The whole area is divided into grids and each grid point has a sphere associated with it to collect photons(surrounding ,some initial radius). Each hitpoint is mapped into grids with the help of these spheres.
There are two things i have to deal with in case of subsurface scattering.

  • Photon tracing
In case of photon tracing you have to trace the photon with a monte carlo model(this model is suggested to be efficient because here you only have photons of equal energy). At every distance given by absorption coefficient you do a random number generation to see whether the photon is absorbed or scattered.
If photon is absorbed it is stored there in photon map else it is scattered in random direction. My scene consists only of spheres so i check after the photon hits a surface that whether the photon is inside or outside the sphere at every event distance(given by ab coeff)if it is inside the surface i do the scatt or ab otherwise it is just a normal photon.

  • Ray tracing.
While doing ray tracing i kind of do a ray marching along the ray that enters the wet media. This is done by having hit points at fixed distances(given by the ab and scatt coeffs) and these hit points corresponds to the same pixel.

No comments:

Post a Comment