Log out

Doug Kavendek - Portfolio

Photon

Photon Magnets
Title Photon Magnets
Date 2004
Platforms Windows, others
Created For Stevens Scholars program
More Info Photon Magnets final report
01.jpg
Interesting swirl effect generated just with photon magnets

I was able to perform research into photon mapping as part of the Summer Scholars program at my school. I created what I called a photon magnet, which I used to give more control over the creation of caustics effects (the focusing of light, through refraction or reflection). Typically, caustics can only be formed by physically simulating the light moving through various objects in a scene, but with photon magnets I gave more control of the focusing of light to the user, without requiring any refracting or reflecting objects at all.

I implemented this for POV-Ray, a very complete ray tracer that has its source code freely available. This was the first time I had to try to implement a new feature within a large pre-existing code base, so I spent some time working on getting accustomed to that. I also had to understand how their implementation of photon mapping worked, in order to control the photons correctly - many of my earliest attempts led to some crazy results.

05.jpg
Visualization of a focusing photon magnet in Moray

POV-Ray renders scenes by parsing text files written in its own special language. This can be somewhat difficult to use in some situations, so there is a visual editor, Moray, which has an SDK open for people to create plugins. Using this SDK, I created a plugin to interface with my photon magnet structure, and which would allow the user to more adequately see the effects of the photon magnets, through dynamic creation of light cones and targets.

In addition to simulating caustics, photon magnets can also be used to create very easily directed light sources. Each photon magnet can either be a conical or cylindrical spotlight, or a focusing beam, and the exact cone of light is visually represented in Moray, through a wireframe and target object. In this way, the user can very easily see where a light will be hitting, or adjust the light to hit very specific objects. Also, there is a target parameter which can be used to aim one of these lights specifically at a given named object in the scene, and so will always aim at it, regardless of where the object is moved.

06.jpg
Lighting individual targets is extremely easy

The end result of all this is just a more easily controllable source of light caustics. Almost everything could be done already, but would require more setup, and more work to achieve the desired effect. The one exception seems to be a strange side-effect of allowing the user direct control of the falloff parameter of photon magnets -- interesting caustic patterns can be created by setting this to unrealistic values.


03.jpg
Photon magnet light interacting with reflective and refractive surfaces
04.jpg
The falloff parameter can create interesting effects