home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 1 / crawlyvol1.bin / tt / raysh402 / guide.tex / node10_mn.html < prev    next >
Text File  |  1992-02-09  |  4KB  |  91 lines

  1.  
  2. <H1><A ID="SECTION00440000000000000000">
  3. Antialiasing</A>
  4. </H1>
  5.  
  6. <P>
  7. Given a screen of a fixed size, creating an image is accomplished by
  8. sampling each pixel one or more times in order to determine what can
  9. be seen ``through'' that pixel by the camera.  A pixel thus covers
  10. a square area of the image plane, not just a single point.
  11.  
  12. <P>
  13. If a pixel is not sampled at the proper rate, aliasing will result.
  14. Aliasing usually appears as ``jaggies'' or ``stair steps'' in the image.
  15. In order to reduce these and other artifacts, <#176#><#1781#><EM>rayshade</EM><#1781#><#176#> provides
  16. an adaptive jittered antialiasing scheme that attempts to detect where
  17. increased sampling rates are needed.
  18. In jittered sampling, the location at which a sample is taken is
  19. perturbed by a random amount.  This perturbation reduces aliasing
  20. but adds noise to the image.  Appendix B describes how jittered
  21. time sampling is implemented in <#177#><#1783#><EM>rayshade</EM><#1783#><#177#>.
  22.  
  23. <P>
  24. The adaptive sampling scheme implemented in <#178#><#1785#><EM>rayshade</EM><#1785#><#178#> begins
  25. by sampling each pixel on the current scanline once.
  26. For each pixel on the scanline, the contrast between it and its
  27. four immediate neighbors is computed.  If this contrast is greater
  28. than a user-specified maximum in any color channel,
  29. the pixel and its
  30. neighbors are all supersampled by firing an additional
  31. <#179#><tex2html_verbatim_mark>#math49#<I>numsamples</I><SUP>2</SUP> - 1<#179#> rays through those pixels that have not already been
  32. supersampled.  This process is repeated for the current scanline
  33. until a pass is made without any
  34. pixel being supersampled.
  35.  
  36. <P>
  37. <DL>
  38. <DT><STRONG><#4628#><#4628#></STRONG></DT>
  39. <DD><#1180#><TT>contrast</TT><#1180#> <#1181#><EM>redcont greencont bluecont</EM><#1181#> 
  40. <BR>    Set the maximum allowed contrast between four color
  41.     samples when adaptive supersampling is used.
  42.     The contrast test is applied to each color
  43.     channel separately.
  44. </DD>
  45. </DL>The default maximum contrast values for the red, green, and blue
  46. channels are 0.25, 0.2, and 0.4, respectively.
  47.  
  48. <P>
  49. <DL>
  50. <DT><STRONG><#4629#><#4629#></STRONG></DT>
  51. <DD><#1184#><TT>sample</TT><#1184#> <#1185#><EM>n</EM><#1185#> [<#1186#><TT>nojitter</TT><#1186#>] 
  52. <BR>    Use <I>n</I><SUP>2</SUP> samples when performing jittered
  53.     sampling.  The maximum legal value is 5.
  54.     If <#189#><TT>nojitter</TT><#189#> is specified, sample locations
  55.     and times will not be jittered.
  56. </DD>
  57. </DL>By default, 3<SUP>2</SUP> jittered samples are taken.
  58.  
  59. <P>
  60. A given set of sample values must be filtered
  61. in order to
  62. assign a color to a pixel.  Ideally, when performing filtering
  63. for a specific pixel,
  64. the filter will consider samples from neighboring regions.  In
  65. <#192#><#1787#><EM>rayshade</EM><#1787#><#192#>, the filtering applied to a pixel makes use of samples
  66. taken for that pixel alone.  However, one may increase the size
  67. of the filter that is applied in order to approximate the results
  68. a more robust filtering scheme.
  69.  
  70. <P>
  71. <DL>
  72. <DT><STRONG><#4632#><#4632#></STRONG></DT>
  73. <DD><#1189#><TT>filter</TT><#1189#> <#1190#><EM>type</EM><#1190#> [<#1191#><EM>width</EM><#1191#>] 
  74. <BR>    Use the indicated filter type with the given width,
  75.     in pixels.
  76.     Supported filter types are <#197#><TT>gauss</TT><#197#> (Gaussian)
  77.     and <#198#><TT>box</TT><#198#> (the default).
  78. </DD>
  79. </DL>The default filter width is 1.0 for a box filter, 1.8 for a Gaussian
  80. filter.  The filter and pixel centers always coincide.
  81. When sampling a pixel, samples are taken over the area of
  82. the pixel filter, which is not necessarily the same as the area
  83. of the pixel itself.
  84.  
  85. <P>
  86. Jittered sampling is used in <#200#><#1789#><EM>rayshade</EM><#1789#><#200#> to sample extended light
  87. sources as well.  A total of <I>samples</I><SUP>2</SUP> samples are taken of
  88. each extended light source in order to determine the extent of shadowing.
  89.  
  90. <P>
  91.