I have been trying to implement photon mapping following the book “realistic image synthesis using photon mapping”. Ive come into some problems like what to do with the photon’s power during the photon tracing stage and how to use the photon map for rendering. I am probably misunderstanding some parts so its producing strange results as you can see below.
I have been working on the data structure that is used in photon mapping during the photon emission stage. The kd tree seems to be choice so, I have been trying to implement a naive implementation just to get something working.
Below are some images debugging the data structure using opengl. They show the behaviour with different search radii with a max photon count of 100.
I implemented Ward’s anisotropic BRDF. Anisotropy in this context refers to the materials where the reflection is directionally dependent around the point about the normal. Materials such as brushed metal or hair are examples of anisotropic materials.
I have implemented two new materials. The first one is blend material, which adds a lot of power to the material system since you can arbitrarily use different materials on parts of the same mesh. The second material is two-sided material, which is useful for thin translucent materials like paper, lights, and leaves since it allows the back-face to receive light.
Below are three examples. The first one shows the blend material in action, the left sphere is a reflective sphere and the right is the blended material with a rough refractive material and the mask is the world map. The white parts receive 100% of material A and the black parts will receive 100% of material B, anything in-between receives a proportion of both.
For the two sided material the front facing parts relative to the camera receive material A while the back facing parts receive material B, and a flag for translucency to allow light to go through the back is optional and set as off by default. The second image shows a open cylinder with a two sided material. The third image shows an render with a spherical light place inside a tube, the interesting thing is that most of the light illuminating the scene is from indirect lighting.