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

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