Photon Mapping Parameters (or properties)
Choreography Properties
Photons Cast
This attribute determine the number of photons that gets stored in the photon map. The actual number of photons shot from the light sources will usually be lower than that. One single photon may be stored several times. Actually almost every time it interacts with a surface. The number of surfaces a photon may interact with is roughly determined by the Max Bounces attributes.
The number of photons stored have an impact on the render time. Even more so when Precompute Irradiance is not set. Photons are shot before the actual renders starts and is not resolution dependent. However, it impacts the Final Gathering step somewhat because the larger the photon map, the longer it takes to find the proper photon in it.
Sample Area
Sample Area and Photon Samples are related attributes. After photons have been stored in the photon Map, it is necessary to do an estimate of the density in photons in order to compute the irradiance at each photon position. This is performed by accumulating all photon energy in the neighborhood of each photon. This neighborhood is a disk with a radius determined by the Sample Area.
Sample Area attribute is specified in 100th of a centimeter. So a sampling area of 100 means a radius of one centimeter. The smallest specifiable area is 0.01 which means a radius of 1 micrometer. Small sampling area may be necessary when rendering a scene with very tight caustics.
Photon Samples
Photon Samples and Sample Area are related attributes. When computing the irradiance estimate, Photon Samples determines the maximum number of photons that are accumulated in the neighborhood of each photons. However, in area where the photons are very sparse, we don't want the irradiance estimate to grow so large that it would include photons which are too far away. This would falsify the estimate. Thus, the neighborhood will never go beyond the Sample Area. On the other hand, in areas where the photons are very dense, the neighborhood may grow much smaller than the Sample Area.
Basically, the irradiance estimate will stop whenever it reaches one of the two limits defined by Sample Area or Photon Samples.
Photon Samples have a major impact on the time it takes to precompute irradiance immediately after storing the photons or to compute irradiance on the fly when rendering caustics.
Intensity
Intensity may be used to increase or decrease the intensity of the caustic effects. It may also be used to increase or decrease the indirect illumination effect but it is less usefull in this respect.
Usually, the default setting of 100% is well balanced with the lights in a scene. However, the illumination computed by the photons is directly dependent on the light Intensity and Fall-Off parameters. If the light Fall-Off goes beyond the points of interest in a scene, the photons energy will be overestimated. It will then be necessary to compensate by lowering the choreography Intensity attribute. For further information about that, see the Fall-Off attribute description below.
Max Bounces
Determines the maximum number of bounces off surfaces that a single photon is allowed to do before being extinguished.
This have an impact on the quality of the indirect illumination result. Real photons can bounce almost ad infinitum. In GI, we have to stop somewhere. Clearly, it would not work to have, lets say, 1 photon bouncing 1 000 000 times. The default value of 20 is fine for almost all situations. But you could get darker shadowed areas by lowering the Max Bounces.
Another use of a low Max Bounces is if you want to use the photon map directly for indirect illumination by setting Final Gathering OFF. For some particular scenes, where indirect illumination is small compared to direct illumination, this may give acceptable result and reduce the render time significantly. In this case, a Max Bounces of 2 or 3 will give more uniform photons in the map.
When rendering caustics. Max Bounces determine the maximum number of time a photon will bounce off reflective surfaces or the maximum number of refractive surface it can pass through before it is aborted. When rendering caustics, photons are stored at the first non-reflective or non-refractive surface it encounters and it is not bounced any further afterward.
This attribute have no real impact on the render time.
Caustics
This is a switch which sets the Photon Mapping to render caustics instead of rendering indirect illumination. It basically turns OFF both Final Gathering and Precompute Irradiance and turns ON a filter for the photon irradiance calculation.
When Caustics is turned ON, photons are stored in the photon map only if they have bounced off a reflective surface or passed through a refractive surface. This ensures that the photons are used in the most effective way for producing caustics. Care should be taken to focus light as tightly as possible on the caustics producing objects though since any photons shot from the lights which do not reach a caustics producing surface will be lost and the time taken to cast it will also be lost.
Final Gathering
This attribute and Monte-Carlo Samples have the most impact on the render time. This turns ON or OFF the final gathering step of the Photon Mapping algorithm. The final gathering consist of accumulating multiple samples of the environment for each pixel in order to compute an estimate of the global illumination received by the pixel. The number of samples is determined by the Monte-Carlo Samples attribute.
Turning Final Gathering OFF means that the renderer will use the illumination directly from the photons stored in the photon map. In some scenes where the illumination comes mostly from lights and where indirect illumination is only used to add depth to the image, it is possible to get good results without Final Gathering. However, even with 1 million photons, the illumination as stored on the photon map is only a rough approximation of the actual true illumination of the scene. This will invariably produce false illumination in corners or edges of objects or on objects with a finely detailed surface.
Turning Final Gathering ON will make sure that each pixel gets its fair share of illumination estimate. Thus no corners, edges or fine surface details will be left in the dark.
Monte-Carlo Samples
This determines the number of samples of the environment at each pixel in the rendered image. A value of 150 normally gives good results but it is very dependent on the scene lights setup. Values lower than 50 gives strong illumination aliasing and artifacts.
This attribute have the most impact on the render time since it is resolution dependent and imposes, for each pixel, an illumination computation which is directly proportional to the number of samples.
Normally, a Monte-Carlo estimate would require much more samples than 150. However, the algorithm uses the same Quasi-Monte-Carlo sampling pattern at each pixels thus reducing significantly the noise in the render. This, however at the expense of a very biased render.
Jittering
In scenes illuminated mostly by indirect illumination such as a room where the illumination comes through a door from another room for example or scenes with very sharp illumination contrasts in the environment, because the Final Gathering uses the exact same sampling pattern from pixel to pixel, it will produce geometric patterns in the illumination.
Jittering allows to add some randomization to the sampling pattern. 100% Jittering will basically produce sampling patterns similar to a pure Monte-Carlo sampler thus producing noise in the illumination calculation. By specifying a lower percentage, it is possible to find an acceptable tradeoff between the noise and the geometric illumination patterns.
Unfortunately, scenes illuminated mostly by indirect illumination are difficult scenes to render for any Monte-Carlo based GI algorithms. It typically produces a lot of noise in the image unless several thousand samples are used per pixel. By keeping a regular sampling pattern and adding some jittering to it, some sort of control on the type of noise is relegated to the end user.
Precompute Irradiance
This attribute should always be ON especially when using Final Gathering as it dramatically reduces the render time.
If Final Gathering is turned OFF, then also turning Precompute Irradiance OFF might accelerate the render. The break even point is around the number of photons vs the number of pixels in the render. Roughly, if the number of pixels to render (taking into account the multi-passes or the anti-aliasing computations) is lower than the number of photons, then not precomputing irradiance might be advantageous. This is an unlikely situation though because assuming 1 million photons and a 640x480 pixels images with Anti-Aliasing, it is very likely that the total number of actual pixels computations will be higher that 1 million because of the adaptive pixel sub-sampling produced by anti-aliasing.
Another reason to turn Precompute Irradiance OFF when Final Gathering is also OFF is because it will produce different illumination patterns. This might be interesting for someone who wants to develop a personal rendering style.
Calculate Radiosity
This is not a property per se but can be selected in the choreography contextual menu (right-click menu). Selecting that option will calculate a photon map.
This option does the same calculation as when a final render is launched so it is not necessary to select this option before launching a final render to file. This option allows to test radiosity with progressive render. After changing something in the scene and before trying a quick or a progressive render, select this option to recalculate the photon map.
Note: Contrary to the old A:M implementation of radiosity where this option did produce an actual map of the illumination in a Targa file, this option will not do that for Photon Mapping. Even though there is the word Map in Photon Mapping, this map is a 3D spatial partitioning data structure and is not storable in an image file, nor usable as an image.
Light Properties
In radiosity renderers, light is treated slightly differently than for ray-tracing. Because Photon Mapping uses and combines both types of calculations.
Ray tracing shoots rays from the eye into the scene and thus it is possible to play tricks on how light intensity is computed. When a ray reaches the light, it knows exactly what the scene looked like from its point of view, because it just traveled through it. Photon Shooting, on the other hand, shoot photons from the light into the scene and when the photon leaves the light, it have no knowledge of the scene characteristics that it will encounter, It is thus not possible to play tricks with light intensity.
Thus, it is important to set the light parameters in such a way that it is compatible between the ray tracing engine and the photon shooting engine. Otherwise, the scene illumination will be unbalanced and it might then be difficult to try to compensate with the other radiosity parameters.
Another very important consideration which is indirectly related to the lights, is the closure of the scene. Photons are emitted from the lights into the scene and are stored (or used) only when they hit an object surface. This means that any photon that does not hit a surface is a lost photon and the time it takes to compute whether or not it hits something is also lost. This can potentially have a very bad effect on the rendering time. As a consequence, a good rule to follow is to always close the scene. For interior scene, it means that the interior should have all the walls, a full floor and a full ceiling. For exterior scenes, set your scene inside a hemisphere and on a floor which extends to the edge of the hemisphere. If you need a black void over your scene, then set your hemisphere to black and its radiance to 0%. By doing this, you ensure that all photons are stored instead of being lost in the void.
Type
Currently, the three lights types are supported with radiosity although with different level of compatibility.
Bulb
Photon shooting is fully compatible with bulb light parameters.
Bulb lights emits photons in all directions. Thus it may very well shoot photons in directions which are not important to the scene. Because of this, in many situations, it is better to use a klieg light instead of a bulb light.
Klieg
For klieg light, there is currently some differences in the way the photons are emitted and how intensity is computed. For one thing, the Width Softness is not directly supported although a klieg light with a width greater than 0 will automatically produce a softened illumination border. Normally, because photons are not used on the first surface they encounter, this should not cause a problem.
Also, in order to help simulate a flat luminaire, when the width of a Klieg light is set to 180° and the Width Softness is set to 100%, the photons are distributed following a cosine law which, in this particular case, is equivalent to a width softness of 100%.
Sun
There are two differences. Photons are emitted only from inside the width of the sun light while for ray tracing, a sun illuminates the whole scene no matter the width of the sun. In Ray-Tracing, the width of the sun is used to help compute soft shadows but photons are emitted strictly in parallel with the direction of the sun thus technically not producing soft shadows although this should not be a problem because photons are not used on the first surface they encounter and are not used to compute direct shadows but only indirect shadows.
The other difference is that because all photons are emitted following a parallel path, there is no photon power falloff. The photon power is strictly determined from the intensity and the fall-off parameters as will be explained below.
Width
Photons are emitted from the whole surface of the light. For a bulb light, photons are emitted from the surface of the sphere determined by the width attribute. For a klieg light and sun light, photons are emitted from the surface of the disk determined by the width attribute.
Width Softness
Width Softness applies to Klieg lights. When shooting photons, the width falloff is not taken into account. Rather, a natural softness emerges from the width of the light.
When the width of a Klieg light is set to 180° and the Width Softness is set to 100%, the photons are distributed following a cosine law.
Fall-Off
Fall-Off is the most important attribute to set right. Photon energy is balanced with the intensity of the light at the specified fall-off distance and further away.
With Ray-Tracing, light intensity is pretty much constant between the light source and the fall-off distance. The specified light Intensity is achieved at the fall-off distance and starts to fall-off as distance increases further away from the light. The intensity decrease follows the inverse square law meaning that intensity decrease to the square as the distance increases. Or said from another point of view: light intensity increases as it approaches the light but stops increasing(1) when it reaches the fall-off distance. With ray-tracing, it is possible to play tricks with light intensity because light intensity is computed in an analytic way.
When emitting photons however, this is a different story. Photons don't loose their energy as they travel. Instead, the total energy that reaches a surface is derived from the photon density on that surface. The inverse square law is a direct consequence of the dispersion of photon as they leave a point source. Thus, it is not possible to play the same tricks with the photon energy.
A consequence of all this is that in order to have a balanced photon illumination with the ray-traced illumination, the fall-off distance of the lights needs to be set carefully. The common habit of enclosing the scene inside the fall-off distance is a no-no with photon mapping. This is often used when trying to compensate for the absence of indirect illumination but with the additional indirect illumination that is brought by Photon Mapping, this will only produce wildly over-illuminated scenes.
As a rule of thumb, set your fall-off distances is such a way that it does not reach any of the objects in the scene and then adjust the intensity of the lights to get the illumination you are looking for. You can trust photon mapping to add much more illumination to your scene.
(1) This is a simplification. Actually the intensity is not quite constant but very nearly so.
Color
Light color contributes to the intensity. Darker light colors will provide less energy at the same intensity than brighter colors.
Intensity
When using Photon Mapping, the relation between Intensity and the Fall-Off distance is extremely important. Refer to Fall-Off for further explanation.
The specified Intensity is the light intensity that objects get within and up to the light fall-off distance. From the fall-off distance and further away, light intensity decreases. With Ray-Tracing, light intensity will practically never increase beyond the specified Intensity alue even if the distance is extremely near the light source. This is not the case with Photon Mapping.
Attenuation
In real word physics, light attenuation strictly follows the inverse square law. Photon Mapping strictly follows that law too. Because of that, you should always leave the light attenuation to 100%.
Surface Properties
Surface attributes are considered the same way whether they come from the whole object, a group or a material.
Diffuse Color
Darker color will absorb more photons. This means less photons bounces. Black color will absorb all photons thus photons hitting a black surface will not bounce back in the environment.
The diffuse color is also used to filter the energy of the photons be it for radiosity to produce color bleeding or for caustics produced by reflection or refraction.
Transparency
Transparency defines the percentage of photons which are bounced back in the environment vs the percentage of photons which are filtered through the surface. A 10% transparent surface will bounce back 90% of the non absorbed photons and let through 10% of the non absorbed photons.
Non-absorbed photons are dependent on the darkness of the color attribute and the radiance attribute.
Index of Refraction
Index of Refraction defines a transparent surface which will bend the photon path thus potentially producing Caustics. Potentially because if the Caustics attribute is turned OFF, then there will not be enough photons casted on the refractive objects to actually produce visible caustics.
When producing caustics, a large number of photons must reach the refractive or transparent surface. Thus, when setting up a scene for producing caustics, it is necessary to light the caustics producing surfaces as tight as possible.
Reflectivity
Reflectivity defines a reflective surface which will reflect photon thus potentially producing Caustics. Potentially because if the Caustics attribute is turned OFF, then there will not be enough photons casted on the reflective objects to actually produce visible caustics.
When a photon hits a surface, Reflectivity is in competition with Transparency and transparency have priority. If a surface is both transparent and reflective, the transparency takes precedence. For instance, if a surface was to be defined as 100% transparent and 100% reflective, then 100% photons would pass through the surface thus leaving no more photons to be reflected.
The priority of transparency over reflectivity is even more important to consider when rendering scenes with the "Caustics" attribute turned ON. In this case, if a surface is both transparent and reflective, then all photons will be refracted and none will be reflected. This is because caustics require a very even distribution of photons and thus cannot be split between refraction and reflection. Transparent object which produces caustics are generally convex and will converge photons, thus producing nice refracted caustics while they will generally diverge reflected photons, thus producing no observable reflected caustics anyway and this is why refractive caustics have precedence over reflective caustics.
Reflecting photons is different than bouncing photons. When reflecting photons, the direction the photon bounces back is very precise just like in a mirror while when a photon is bounced back by a diffuse surface, the direction the photon bounces back is at random.
When producing caustics, a large number of photons must reach the reflective surface. Thus, when setting up a scene for producing caustics, it is necessary to light the caustics producing surfaces as tight as possible.
Radiance
Radiance is the equivalent of reflectance in the radiosity literature. Reflectance is not the same thing as reflectivity. Reflectance specify the amount of photons that are bounced back in the environment while relfectivity describes how images of the environment are reflected in the surface.
The default value of 100% for radiance will generally give good results. However, in the real world, even a canonical Munsen white piece of paper only have an average reflectance of about 92%. A radiance of 100% on a white surface would mean that the photons are not absorbed and should theoretically bounce ad infinitum which is not realistic nor feasible computationally. So a good rule of thumb for radiance value in normal radiosity situations is to simply set it at around 90% to 95% and let the color attribute take care of the true reflectance.
The Radiance attribute let you control the re-emissivity of the surfaces. For instance, you could enclose your scene inside a hemisphere but set the hemisphere radiance to 0% to make sure that it will not contribute illumination. Or if you want to render caustics, you can set all surfaces radiance to 0% except for the reflective or refractive surfaces which are expected to transmit photons.
|