Motivation:
Typically, photon mapping is designed to be as realistic as possible. However, there can sometimes be artistic reasons to modify how light behaves so that while a scene seems to appear realistic, it is not actually following strict lighting rules. For this project, I have attempted to implement a Photon Magnet object, through which the user can manipulate lighting with a higher level of control. This has been implemented within POV-Ray (Persistence of Vision Raytracer), and is controlled easily within Moray (a modeller for POV-Ray scenes).Implementation:
Before explaining the basics of this project, I need to explain the interaction between POV-Ray and Moray. Within Moray, a user can create a scene, create textures and models, and then export the scene to POV-Ray for rendering. Moray converts its own objects into objects in a scene file, which is then parsed by POV-Ray.Description:
Each Photon Magnet object is affected by each photon-emitting light in the scene. Depending on its attributes, it will interact with these photons.Usage:
In Moray, simply add a Photon Magnet, move it to the desired location, and set the target postion. In order to get a plain white spotlight, you do not need to change any of the settings. However, there must also be some kind of photon-emitting light within the scene, and its distance of this light from the Photon Magnet will affact how bright the Photon Magnet becomes. Sometimes it is preferrable to have a light source close to the Photon Magnet so that it produces a bright light, but the user does not want to actually have a bright light visible within the scene - in this case, I have implemented an additional object (a Photon Magnet Light) in Moray that functions as a photon-emitting light, but does not cast any light within the actual scene. It is visible as a tiny cube, so it is advisable to position this object close to the Photon Magnet, but outside the view of the camera). No additional parameters need to be assigned to this object, as it will, by default, emit photons. The user can, however, scale the object smaller in order to make it less visible, if necessary.Images
Effects of Light Type
Cylindrical light source - oblong shape due to angle, but continuous edges.
|
Spotlight light source - edge bleeds in lower left due to spreading light.
|
Focus light source (with target before surface) - stronger edge bleeding due to higher spreading of light after focal point.
|
Focus light source (with target after surface) - very tight edges with high edge continuity, due to focusing of light.
|
iStrength=0.0 - No effect on other photons.
|
iStrength=0.5 - Photons are half as strong.
|
iStrength=1.0 - All other photons are gone.
|
iStrength=-1.0 - Normal photons are doubled.
|
iStrength=-2.0 - Normal photons are tripled.
|
iStrength=-3.0 - Normal photons are quadrupled.
|
|
|
|
Conclusions
While there are many things that can be done with regular lights just as easily as Photon Magnets, there do remain some things that Photon Magnets can only do, such as the result of using a Falloff greater than 1.0. Additionally, there are several things that are much easier through Photon Magnets, such as aiming lights at exact points, regardless of the position of the source of the light. The user can also create, using the focus light type, the kind of light that would only be possible by physically creating an object to focus a regular beam of light (and which becomes trivial, using Photon Magnets). Also, the user can rotate Photon Magnets in the same way as regular spotlights.