home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #7 / amigamamagazinepolishissue1998.iso / varia / povray3 / povray3_fpu / pov3demo / atmos / atmos2.pov < prev    next >
Text File  |  1997-12-12  |  4KB  |  194 lines

  1. // Persistence Of Vision raytracer version 3.0 sample file.
  2. // File by Dieter Bayer
  3. // Atmospheric environment with spotlights.
  4. //
  5.  
  6. #version 3.0
  7. global_settings { assumed_gamma 2.2 }
  8.  
  9. #include "colors.inc"
  10. #include "textures.inc"
  11.  
  12. camera {
  13.   location <5, 6, -18>
  14.   right 4/3*x
  15.   up y
  16.   direction z
  17.   angle 80
  18.   look_at <0, 4, 0>
  19. }
  20.  
  21. //
  22. // Declare the various atmospheres. 
  23. //
  24. // Note the different reflectivities due to the different scattering models.
  25. //
  26.  
  27. //
  28. // Atmosphere with isotropic scattering (independent of incident light). 
  29. //
  30.  
  31. #declare Atmosphere1 = atmosphere {
  32.   type 1
  33.   samples 50        // Number of samples in first distance interval
  34.   distance 30       // Atmosphere density, similar to fog
  35.   scattering 0.2    // Reflectivity of atmosphere, determines brightness
  36.   aa_level 8        // Level of binary subdivision in case of aa
  37.   aa_threshold 0.1  // Threshold for aa to push in
  38.   jitter 0.25       // Amount of sample jittering
  39. }
  40.  
  41. //
  42. // Atmosphere with Mie cattering, hazy atmosphere (dependent of incident light). 
  43. //
  44.  
  45. #declare Atmosphere2 = atmosphere {
  46.   type 2
  47.   samples 50        // Number of samples in first distance interval
  48.   distance 30       // Atmosphere density, similar to fog
  49.   scattering 1.2    // Reflectivity of atmosphere, determines brightness
  50.   aa_level 8        // Level of binary subdivision in case of aa
  51.   aa_threshold 0.1  // Threshold for aa to push in
  52.   jitter 0.25       // Amount of sample jittering
  53. }
  54.  
  55. //
  56. // Atmosphere with Mie scattering, murky atmosphere (dependent of incident light). 
  57. //
  58.  
  59. #declare Atmosphere3 = atmosphere {
  60.   type 3
  61.   samples 50        // Number of samples in first distance interval
  62.   distance 30       // Atmosphere density, similar to fog
  63.   scattering 1.5    // Reflectivity of atmosphere, determines brightness
  64.   aa_level 8        // Level of binary subdivision in case of aa
  65.   aa_threshold 0.1  // Threshold for aa to push in
  66.   jitter 0.25       // Amount of sample jittering
  67. }
  68.  
  69. //
  70. // Atmosphere with Rayleigh scattering (dependent of incident light). 
  71. //
  72.  
  73. #declare Atmosphere4 = atmosphere {
  74.   type 4
  75.   samples 50        // Number of samples in first distance interval
  76.   distance 30       // Atmosphere density, similar to fog
  77.   scattering 0.2    // Reflectivity of atmosphere, determines brightness
  78.   aa_level 8        // Level of binary subdivision in case of aa
  79.   aa_threshold 0.1  // Threshold for aa to push in
  80.   jitter 0.25       // Amount of sample jittering
  81. }
  82.  
  83. //
  84. // Use atmosphere. 
  85. //
  86.  
  87. atmosphere { Atmosphere1 }
  88.  
  89. //
  90. // Light source not interacting with the atmosphere. 
  91. //
  92.  
  93. light_source { <0, 15, 0> color Gray20 atmosphere off }
  94.  
  95. //
  96. // Spotlights pointing at shaft. 
  97. //
  98.  
  99. light_source { 
  100.   <-10, 0.5, -10> color White
  101.   spotlight
  102.   point_at <0, 5, 0>
  103.   radius 25
  104.   falloff 30
  105.   tightness 2
  106.   atmospheric_attenuation on
  107. }
  108.  
  109. //
  110. // Declare steps. 
  111. //
  112.  
  113. #declare Step = prism
  114. {
  115.   linear_spline
  116.   linear_sweep
  117.   0, 1, 9
  118.   <cos(radians(0*45)), sin(radians(0*45))>, 
  119.   <cos(radians(1*45)), sin(radians(1*45))>, 
  120.   <cos(radians(2*45)), sin(radians(2*45))>, 
  121.   <cos(radians(3*45)), sin(radians(3*45))>, 
  122.   <cos(radians(4*45)), sin(radians(4*45))>, 
  123.   <cos(radians(5*45)), sin(radians(5*45))>, 
  124.   <cos(radians(6*45)), sin(radians(6*45))>, 
  125.   <cos(radians(7*45)), sin(radians(7*45))>,
  126.   <cos(radians(0*45)), sin(radians(0*45))> 
  127.   rotate 22.5*y
  128. }
  129.  
  130. #declare Stair = union {
  131.   object { 
  132.     Step
  133.     scale <10, 0.5, 10>
  134.     translate <0, 0, 0>
  135.   }
  136.   object { 
  137.     Step
  138.     scale <8, 0.5, 8>
  139.     translate <0, 0.5, 0>
  140.   }
  141.   object { 
  142.     Step
  143.     scale <6, 0.5, 6>
  144.     translate <0, 1, 0>
  145.   }
  146. }
  147.  
  148. //
  149. // Declare shaft. 
  150. //
  151.  
  152. #declare Shaft = cylinder {
  153.   <0, 0, 0>, <0, 1, 0>, 1
  154. }
  155.  
  156. //
  157. // Declare object.
  158. //
  159.  
  160. #declare Thing = difference {
  161.   box { <-1, -1, -1> <1, 1, 1> }
  162.   box { <-0.7, -0.7, -1.1>, <0.7, 0.7, 1.1> }
  163.   box { <-0.7, -0.7, -1.1>, <0.7, 0.7, 1.1> rotate 90*x }
  164.   box { <-0.7, -0.7, -1.1>, <0.7, 0.7, 1.1> rotate 90*y }
  165. }
  166.  
  167. //
  168. // Position objects.
  169. //
  170.  
  171. object {
  172.   Stair 
  173.   pigment { color rgb<1.0, 0.3, 0.3> }
  174.   finish { ambient 0.2 diffuse 0.5 }
  175. }
  176.  
  177. object { 
  178.   Thing
  179.   scale <3, 3, 3>
  180.   translate <0, 1.5+3, 0>
  181.   texture { Copper_Metal }
  182. }
  183.  
  184. //
  185. // Room. 
  186. //
  187.  
  188. box { <-25, 0, -25>, <25, 25, 25>
  189.   pigment { color White }
  190.   finish { ambient 0.2 diffuse 0.5 }
  191.   hollow
  192. }
  193.  
  194.