home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Crawly Crypt Collection 1
/
crawlyvol1.bin
/
tt
/
raysh402
/
guide.tex
/
node10_mn.html
< prev
next >
Wrap
Text File
|
1992-02-09
|
4KB
|
91 lines
<H1><A ID="SECTION00440000000000000000">
Antialiasing</A>
</H1>
<P>
Given a screen of a fixed size, creating an image is accomplished by
sampling each pixel one or more times in order to determine what can
be seen ``through'' that pixel by the camera. A pixel thus covers
a square area of the image plane, not just a single point.
<P>
If a pixel is not sampled at the proper rate, aliasing will result.
Aliasing usually appears as ``jaggies'' or ``stair steps'' in the image.
In order to reduce these and other artifacts, <#176#><#1781#><EM>rayshade</EM><#1781#><#176#> provides
an adaptive jittered antialiasing scheme that attempts to detect where
increased sampling rates are needed.
In jittered sampling, the location at which a sample is taken is
perturbed by a random amount. This perturbation reduces aliasing
but adds noise to the image. Appendix B describes how jittered
time sampling is implemented in <#177#><#1783#><EM>rayshade</EM><#1783#><#177#>.
<P>
The adaptive sampling scheme implemented in <#178#><#1785#><EM>rayshade</EM><#1785#><#178#> begins
by sampling each pixel on the current scanline once.
For each pixel on the scanline, the contrast between it and its
four immediate neighbors is computed. If this contrast is greater
than a user-specified maximum in any color channel,
the pixel and its
neighbors are all supersampled by firing an additional
<#179#><tex2html_verbatim_mark>#math49#<I>numsamples</I><SUP>2</SUP> - 1<#179#> rays through those pixels that have not already been
supersampled. This process is repeated for the current scanline
until a pass is made without any
pixel being supersampled.
<P>
<DL>
<DT><STRONG><#4628#><#4628#></STRONG></DT>
<DD><#1180#><TT>contrast</TT><#1180#> <#1181#><EM>redcont greencont bluecont</EM><#1181#>
<BR> Set the maximum allowed contrast between four color
samples when adaptive supersampling is used.
The contrast test is applied to each color
channel separately.
</DD>
</DL>The default maximum contrast values for the red, green, and blue
channels are 0.25, 0.2, and 0.4, respectively.
<P>
<DL>
<DT><STRONG><#4629#><#4629#></STRONG></DT>
<DD><#1184#><TT>sample</TT><#1184#> <#1185#><EM>n</EM><#1185#> [<#1186#><TT>nojitter</TT><#1186#>]
<BR> Use <I>n</I><SUP>2</SUP> samples when performing jittered
sampling. The maximum legal value is 5.
If <#189#><TT>nojitter</TT><#189#> is specified, sample locations
and times will not be jittered.
</DD>
</DL>By default, 3<SUP>2</SUP> jittered samples are taken.
<P>
A given set of sample values must be filtered
in order to
assign a color to a pixel. Ideally, when performing filtering
for a specific pixel,
the filter will consider samples from neighboring regions. In
<#192#><#1787#><EM>rayshade</EM><#1787#><#192#>, the filtering applied to a pixel makes use of samples
taken for that pixel alone. However, one may increase the size
of the filter that is applied in order to approximate the results
a more robust filtering scheme.
<P>
<DL>
<DT><STRONG><#4632#><#4632#></STRONG></DT>
<DD><#1189#><TT>filter</TT><#1189#> <#1190#><EM>type</EM><#1190#> [<#1191#><EM>width</EM><#1191#>]
<BR> Use the indicated filter type with the given width,
in pixels.
Supported filter types are <#197#><TT>gauss</TT><#197#> (Gaussian)
and <#198#><TT>box</TT><#198#> (the default).
</DD>
</DL>The default filter width is 1.0 for a box filter, 1.8 for a Gaussian
filter. The filter and pixel centers always coincide.
When sampling a pixel, samples are taken over the area of
the pixel filter, which is not necessarily the same as the area
of the pixel itself.
<P>
Jittered sampling is used in <#200#><#1789#><EM>rayshade</EM><#1789#><#200#> to sample extended light
sources as well. A total of <I>samples</I><SUP>2</SUP> samples are taken of
each extended light source in order to determine the extent of shadowing.
<P>