Difference between revisions of "Documentation Talk:Tutorial Section 3.7"
Jholsenback (talk | contribs) m (added the section lead in text, and started grammar spelling and wording clean up.) |
Jholsenback (talk | contribs) m (saving wip ... more later) |
||
Line 2: | Line 2: | ||
<!--<indexentry "Radiosity, with conventional lighting">---> | <!--<indexentry "Radiosity, with conventional lighting">---> | ||
− | <p>This section will introduce you to the technique of combining conventional and radiosity lighting. In this | + | <p>This section will introduce you to the technique of combining conventional and radiosity lighting. In this part of the tutorial, we'll be using basically the same sample scene that's located at <code>~/scenes/radiosity/radiosity2.pov</code>, however by changing various radiosity parameters, we'll be able to explore the effects that those changes can have on the scenes appearance and in some cases the render time. Later on, in this tutorial, you can find examples of [[Documentation:Tutorial Section 3.7#Radiosity without conventional lighting|pure radiosity]] illumination.</p> |
− | <p class="Note"><strong>Note:</strong> Unless stated | + | |
+ | <p class="Note"><strong>Note:</strong> Unless otherwise stated, all the images in this section were rendered with the following radiosity settings:</p> | ||
<pre> | <pre> | ||
Line 24: | Line 25: | ||
</pre> | </pre> | ||
− | <p>All objects except the sky have <code>diffuse 0.65</code> and <code>emission 0</code> in their finish block. The sky sphere has a bright blue pigment (what a surprise) with <code>diffuse 0</code> and <code>emission 1.0</code> as finish attributes.</p> | + | <p>Finally, a few more things about the scene setup. All objects except the sky have <code>diffuse 0.65</code> and <code>emission 0</code> in their finish block. The sky sphere has a bright blue pigment (what a surprise) with <code>diffuse 0</code> and <code>emission 1.0</code> as finish attributes.</p> |
− | <p class="Note"><strong>Note:</strong> If using the <code>[[Documentation:Reference Section 3.1#Sky Sphere|sky_sphere]]</code> object, which does not support the <code>finish</code> keyword, instead of a <code>[[Documentation:Reference Section 4.1#Sphere|sphere]]</code> object that does, you will need define a <code>[[Documentation:Reference Section 2.5#The #default Directive|#default]]</code> finish | + | <p class="Note"><strong>Note:</strong> If using the <code>[[Documentation:Reference Section 3.1#Sky Sphere|sky_sphere]]</code> object, which does not support the <code>finish</code> keyword, instead of a <code>[[Documentation:Reference Section 4.1#Sphere|sphere]]</code> object that does, you will need define a <code>[[Documentation:Reference Section 2.5#The #default Directive|#default]]</code> finish in order to affect it's finish properties.</p> |
<p>For example:</p> | <p>For example:</p> | ||
Line 34: | Line 35: | ||
</pre> | </pre> | ||
− | <p> | + | <p class="Hint"><strong>Hint:</strong> You can easily turn radiosity on/off with the use of a conditional statement.</p> |
+ | |||
+ | <pre> | ||
+ | #declare UseRad = yes; | ||
+ | |||
+ | global_settings { | ||
+ | #if (UseRad) | ||
+ | radiosity { | ||
+ | rad settings ... | ||
+ | } | ||
+ | #end | ||
+ | } | ||
+ | </pre> | ||
+ | |||
+ | <p>OK, let's get started! In this set of images, we first have the scene as it should appear without radiosity, in other words the <code>radiosity</code> block has been removed, next with the settings noted above, and finally an image showing the difference between the two. Looking at the difference image, you can see that radiosity greatly affects the shadowed areas when applied in combination with conventional lighting.</p> | ||
+ | |||
+ | <p class="Note"><strong>Note:</strong> The use of <code>emission 1</code> in the finish block of the blue sky is what gives the bluish touch of the whole scene in the radiosity version, as it functions as kind of a diffuse light source.</p> | ||
<table class="matte" width="700px" cellpadding="0" cellspacing="10px"> | <table class="matte" width="700px" cellpadding="0" cellspacing="10px"> | ||
Line 61: | Line 78: | ||
</table> | </table> | ||
− | <p> | + | <p>Radiosity is a highly <em>tunable</em> feature. Using those tunable parameters makes it easy to strike a balance between quality and rendering speed. However, as with most things, higher quality means more render time ... remember, patience is a virtue!</p> |
− | + | <p>For instance, let's examine our test object with default settings, with our reference settings, and finally with some maddeningly high-quality settings. For comparison, below each image you can see the difference to the high-quality version.</p> | |
− | < | ||
<table class="matte" width="700px" cellpadding="0" cellspacing="10px"> | <table class="matte" width="700px" cellpadding="0" cellspacing="10px"> | ||
Line 71: | Line 87: | ||
</td> | </td> | ||
<td> | <td> | ||
− | [[Image: | + | [[Image:TutImgRadA99.png|center|220px<!--class="centerpanel"--->]] |
</td> | </td> | ||
<td> | <td> | ||
− | [[Image: | + | [[Image:TutImgRadA03.png|center|220px<!--class="rightpanel"--->]] |
</td> | </td> | ||
</tr> | </tr> | ||
Line 82: | Line 98: | ||
</td> | </td> | ||
<td> | <td> | ||
− | <p class="caption"> | + | <p class="caption">high-quality render</p> |
</td> | </td> | ||
<td> | <td> | ||
− | <p class="caption"> | + | <p class="caption">tutorial reference settings</p> |
</td> | </td> | ||
</tr> | </tr> | ||
Line 93: | Line 109: | ||
</td> | </td> | ||
<td> | <td> | ||
− | |||
</td> | </td> | ||
<td> | <td> | ||
+ | [[Image:TutImgRadA0399.png|center|220px<!--class="rightpanel"--->]] | ||
</td> | </td> | ||
</tr> | </tr> | ||
Line 103: | Line 119: | ||
</td> | </td> | ||
<td> | <td> | ||
− | |||
</td> | </td> | ||
<td> | <td> | ||
+ | <p class="caption">tutorial reference settings (difference)</p> | ||
</td> | </td> | ||
</tr> | </tr> | ||
</table> | </table> | ||
− | <p>Changing <code>brightness</code> changes the intensity of radiosity effects. | + | <p>Changing the <code>brightness</code> changes the intensity of radiosity effects. Theoretically specifying <code>brightness 0</code> would be the same as without radiosity, however in practice POV-Ray doesn't accept a zero value. As a rule <code>brightness 1</code> should work correctly in most cases. If the effects are too strong you <em>can</em> reduce this, though this is not recommended, as it's usually an indication that your textures are too bright and your illumination too dim. Larger values can lead to quite strange results in most cases.</p> |
<table class="matte" width="700px" cellpadding="0" cellspacing="10px"> | <table class="matte" width="700px" cellpadding="0" cellspacing="10px"> | ||
Line 137: | Line 153: | ||
</table> | </table> | ||
− | <p>The <code>recursion_limit</code> setting primarily affects the brightness of shadows, nooks and corners. The images below show the results of setting this parameter to 1, 2 and 5 respectively, with the | + | <p>The <code>recursion_limit</code> setting primarily affects the brightness of shadows, nooks and corners. The images below show the results of setting this parameter to 1, 2 and 5 respectively, with the bottom group of images showing the difference to our reference setting of <code>recursion_limit 3</code>:</p> |
<table class="matte" width="700px" cellpadding="0" cellspacing="10px"> | <table class="matte" width="700px" cellpadding="0" cellspacing="10px"> |
Revision as of 13:33, 21 January 2011
Radiosity with conventional lighting
This section will introduce you to the technique of combining conventional and radiosity lighting. In this part of the tutorial, we'll be using basically the same sample scene that's located at ~/scenes/radiosity/radiosity2.pov
, however by changing various radiosity parameters, we'll be able to explore the effects that those changes can have on the scenes appearance and in some cases the render time. Later on, in this tutorial, you can find examples of pure radiosity illumination.
Note: Unless otherwise stated, all the images in this section were rendered with the following radiosity settings:
global_settings { radiosity { pretrace_start 0.08 pretrace_end 0.01 count 150 nearest_count 10 error_bound 0.5 recursion_limit 3 low_error_factor 0.5 gray_threshold 0.0 minimum_reuse 0.005 maximum_reuse 0.2 brightness 1 adc_bailout 0.005 } }
Finally, a few more things about the scene setup. All objects except the sky have diffuse 0.65
and emission 0
in their finish block. The sky sphere has a bright blue pigment (what a surprise) with diffuse 0
and emission 1.0
as finish attributes.
Note: If using the sky_sphere
object, which does not support the finish
keyword, instead of a sphere
object that does, you will need define a #default
finish in order to affect it's finish properties.
For example:
#default {finish { diffuse 0 emission 1 }}
Hint: You can easily turn radiosity on/off with the use of a conditional statement.
#declare UseRad = yes; global_settings { #if (UseRad) radiosity { rad settings ... } #end }
OK, let's get started! In this set of images, we first have the scene as it should appear without radiosity, in other words the radiosity
block has been removed, next with the settings noted above, and finally an image showing the difference between the two. Looking at the difference image, you can see that radiosity greatly affects the shadowed areas when applied in combination with conventional lighting.
Note: The use of emission 1
in the finish block of the blue sky is what gives the bluish touch of the whole scene in the radiosity version, as it functions as kind of a diffuse light source.
Radiosity is a highly tunable feature. Using those tunable parameters makes it easy to strike a balance between quality and rendering speed. However, as with most things, higher quality means more render time ... remember, patience is a virtue!
For instance, let's examine our test object with default settings, with our reference settings, and finally with some maddeningly high-quality settings. For comparison, below each image you can see the difference to the high-quality version.
Changing the brightness
changes the intensity of radiosity effects. Theoretically specifying brightness 0
would be the same as without radiosity, however in practice POV-Ray doesn't accept a zero value. As a rule brightness 1
should work correctly in most cases. If the effects are too strong you can reduce this, though this is not recommended, as it's usually an indication that your textures are too bright and your illumination too dim. Larger values can lead to quite strange results in most cases.
The recursion_limit
setting primarily affects the brightness of shadows, nooks and corners. The images below show the results of setting this parameter to 1, 2 and 5 respectively, with the bottom group of images showing the difference to our reference setting of recursion_limit 3
:
You can see that values higher than 3 do not lead to any better results in such a quite simple scene. In most cases values of 1 or 2 are sufficient, especially for outdoor scenes.
The error_bound
value mainly affects the structures of the shadows. Values larger than the default of 1.8 do not have much effect, they make the shadows even flatter. Extremely low values can lead to very good results, but the rendering time can become very long, and you may need to modify other parameters to avoid a grainy appearance:
Somewhat related to error_bound
is low_error_factor
. It reduces error_bound during the pretrace phase. Changing this can be useful to eliminate artifacts.
From now on, we'll be using recursion_limit 1
, error_bound 0.2
and low_error_factor 1.0
to emphasize the effects of the next parameters we'll have a look at.
The following 3 images illustrate the effect of count
. It is a general quality and accuracy parameter leading to higher quality and slower rendering at higher values. They're not a cure-for-all though. For the difference images we compared with count 150
.
Another parameter that affects quality is nearest_count
. You can use values from 1 to 20, default is 5; we're comparing to a value of 10 here:
Again higher values lead to less artifacts and smoother appearance but slower rendering.
nearest_count
also accepts a second parameter, which activates adaptive pretrace, providing a good means of speeding up pretrace without significant loss of quality (not shown here); the value must be smaller than the first parameter (e.g. nearest_count 20,10
). When set, POV-Ray will stop pretracing individual areas of the image where the average sample density already satisfies this second value, thereby avoiding to trace low-detail areas over and over again for little gain, while still being able to drill down deep into high-detail areas.
minimum_reuse
influences at which minimum distance previous radiosity samples are always reused during calculation, affecting quality and smoothness in nooks and corners. Higher values generally give a smoother appearance, at the cost of corner detail, while lower values may cause corners to look splotchy unless the other parameters (most notably count
and nearest_count
) are set for higher quality as well.
As minimum_reuse
must be lower than maximum_reuse
, to avoid a parse error with the highest setting we're using minimum_reuse 4.0
for these three images.
Another important value is pretrace_end
. It specifies how many pretrace steps are calculated and thereby strongly influences the speed. Usually lower values lead to better quality, but it is important to keep this in good relation to error_bound
.
Normally in the final trace no additional radiosity samples are taken unless absolutely needed. You can change this by adding always_sample on
, allowing you to increase pretrace_end
to speed up rendering. Note however that this is very prone to artifacts such as visible render block boundaries and horizontal "smearing", so it is usually only useful for test renders. You should also use a low setting for nearest_count
, or you may actually increase the rendering time (and the probability of getting the mentioned artifacts!).
The effect of max_sample
is similar to brightness
. It does not reduce the radiosity effect in general but weakens samples with brightness above the specified value.
You can strongly affect things with the objects' finishes. In fact that is the most important thing about radiosity. Normal objects should have emission finish 0 (default). Objects with emission > 0 actually act as light sources in radiosity scenes.
Remember that the default finish values used until now were diffuse 0.65 emission 0
.
Finally you can vary the sky in outdoor radiosity scenes. In all these examples it is implemented with a sphere object.
finish { emission 1 diffuse 0 }
and the pigment of the original sample scene were used until now. The following images show some variations: