home *** CD-ROM | disk | FTP | other *** search
/ Ray Tracing Box / RAY_CD.mdf / raytrace / _pov_dat / ntsky / nightsky.pov < prev    next >
Text File  |  1994-03-10  |  5KB  |  290 lines

  1. // povray 2.x source file
  2. // nightsky.pov by Norm Bowler
  3.  
  4. /* Features:
  5.  
  6. * Awesome night sky w/ stars & milky way.  Stars gradually blocked 
  7.   toward horizon.
  8.  
  9. * Pretty darn good moon & clouds too.  Clouds painted on plane 
  10.   parallel to ground instead of on sky sphere for improved perspective.
  11.  
  12. * Maxfield Parrish at night without girls in gauzy dresses.
  13.  
  14. * Adjustable brightness and alternate declares for "daytime"
  15.  
  16. */
  17.  
  18.  
  19.  
  20. ////////////////////
  21. // Setup
  22. ////////////////////
  23.  
  24. #include "colors.inc"
  25. #include "textures.inc"
  26.  
  27. default{
  28.   finish{
  29.     ambient .2
  30.     diffuse .4
  31.   }
  32. }
  33.  
  34. light_source {<800, 100, 00> color White}
  35.  
  36. camera {
  37.    location  <0, 4,-20>
  38.    direction <0, 0,  .9>
  39.    up        <0, 1,  0>
  40.    right   <4/3, 0,  0>
  41.    look_at   <0, 0, 100>
  42. }
  43.  
  44. /*  
  45. // alternate camera position to show closeup of moon (for testing)
  46. camera {
  47.    location  <0, 4,-20>
  48.    direction <0, 0,  7>
  49.    up        <0, 1,  0>
  50.    right   <4/3, 0,  0>
  51.    look_at   <300, 300, 900>
  52. }
  53. */
  54.  
  55.  
  56.  
  57. ////////////////////
  58. // Declares
  59. ////////////////////
  60.  
  61. #declare Br=1 //Brightness constant for color values
  62.  
  63. /*
  64. //daytime section begins
  65. //alternate light source for more direct light
  66. light_source {<250, 700, -500> color White}
  67.  
  68. #declare Br=3 //brighter colors
  69.  
  70. //more light
  71. default{
  72.   finish{
  73.     ambient .3
  74.     diffuse .7
  75.   }
  76. }
  77. // daytime section ends
  78. */
  79.  
  80. #declare BL1=Br*.35  //blue level for horizon
  81. #declare BL2=Br*.05  //blue level for zenith
  82.  
  83. // mountain color
  84. #declare TerrainColor= color red Br*.1 blue Br*.2 green Br*.1
  85.  
  86.  
  87.  
  88. ////////////////////
  89. // Objects
  90. ////////////////////
  91.  
  92. /*
  93. //test object - give ripples something to reflect.
  94. box {
  95.    <-5,0,10>,
  96.    <5,10,15>
  97.    pigment {color Red}
  98. }
  99. */
  100.   
  101.  
  102.  
  103. // Sky sphere 
  104. sphere { <0, 0, 0>, 1000
  105.  
  106. //tex 1 : blue 
  107. texture {
  108.   pigment {gradient y
  109.     color_map {
  110.       [0   color blue BL1]
  111.       [1   color blue BL2]
  112.     }
  113.     scale 800
  114.   }
  115.   finish {Luminous}
  116. }
  117.  
  118. //tex2:  Milky Way - comment out for daytime
  119. texture{
  120.   pigment {agate
  121.     color_map {
  122.       [0   color Clear]
  123.       [.75  color Clear]
  124.       [1   color White filter .93 ]
  125.     }
  126.     scale <4000,700,4000>
  127.     translate <300,700,0>
  128.   
  129.   }
  130.   finish {Luminous}
  131.  
  132. }
  133.  
  134. //tex3: stars -- comment out for daytime
  135. texture{
  136.   pigment {granite 
  137.     //turbulence 1
  138.     color_map {
  139.       [0   color Clear]
  140.       [.8  color Clear]
  141.  
  142.       [.8  color Gray15]
  143.       [.92  color Gray70]
  144.       [.92  color red 1 green .8 blue .75]
  145.       [1   color red .95 blue 1 green .95]
  146.     }
  147.    scale 10}
  148.    finish {Luminous}
  149. }
  150.  
  151.  
  152.  
  153. //tex 4 : opaque to block low stars
  154. texture {
  155.   pigment {gradient y
  156.     color_map {
  157.       [0    color blue BL1 filter .1]
  158.       [.25  color blue BL1-((BL1-BL2)*.25) filter .6]
  159.       [.3   color blue BL1-((BL1-BL2)*.3)  filter 1]
  160.       [.35  color Clear]
  161.       [1    color Clear]
  162.     }
  163.     scale 800
  164.   }
  165.   finish {Luminous}
  166. }
  167. no_shadow
  168. }
  169.  
  170.  
  171.  
  172. //sea
  173. plane {y 0
  174.   pigment {color blue Br*.3 green Br*.1 red Br*.08}
  175.   finish {reflection .5}
  176.   normal {ripples .1
  177.     translate <0, 0, -100>
  178.   }
  179. }
  180.  
  181.  
  182.  
  183. //mountains
  184. height_field {
  185.   gif
  186.   "nisky-mt.gif"
  187.   scale <1500, 120, 400> 
  188.   translate <-750, -30, -200>
  189.   rotate <0,20,0>
  190.   translate <0,0,250>
  191.   pigment {color TerrainColor}
  192. }
  193.  
  194.  
  195.  
  196. //clouds
  197. plane {y  122
  198.   pigment {bozo
  199.     turbulence .5
  200.     color_map {
  201.       [0   color Clear]
  202.       [.7  color Clear]
  203.       [.75  color red Br*.2 green Br*.2 blue Br*.2 filter .6]
  204.       [1   color red Br*.05 green Br*.05 blue Br*.05 filter .1]
  205.     }
  206.     scale <400,30,30>
  207.   }
  208.   finish {Luminous}
  209.   no_shadow
  210. }
  211.  
  212.  
  213.  
  214. //moon
  215. sphere { <300,300,900>, 50
  216.   //base color
  217.   texture {
  218.     pigment { color Quartz}
  219.   }
  220.  
  221.   //craters 1
  222.   texture  {
  223.     pigment{leopard
  224.       turbulence .3
  225.       color_map {
  226.         [0   color Clear]
  227.         [.55 color Clear]
  228.         [.7  color CadetBlue]
  229.         [.75 color Clear]
  230.         [1   color Clear]
  231.       }
  232.       scale 6
  233.     }
  234.   }
  235.   
  236.   //craters 2
  237.   texture  {
  238.     pigment{leopard
  239.       turbulence .2
  240.       color_map {
  241.         [0   color Clear]
  242.         [.45 color Clear]
  243.         [.7  color CadetBlue]
  244.         [.8 color Clear]
  245.         [1   color Clear]
  246.       }
  247.       scale 5
  248.       rotate <22,67,9>
  249.       translate <51,5,50>
  250.     }
  251.   }
  252.  
  253.   //craters 3  
  254.   texture {
  255.     pigment{leopard
  256.       turbulence .3
  257.       color_map {
  258.         [0   color Clear]
  259.         [.4 color Clear]
  260.         [.7  color CadetBlue]
  261.         [.75 color Clear]
  262.         [1   color Clear]
  263.       }
  264.       scale 8
  265.       translate <32,17,12>
  266.     }
  267.   }
  268.  
  269.   //craters 4
  270.   texture {
  271.     pigment{leopard
  272.       turbulence .2
  273.       color_map {
  274.         [0   color Clear]
  275.         [.35 color Clear]
  276.         [.7  color CadetBlue]
  277.         [.75 color Clear]
  278.         [1   color Clear]
  279.       }
  280.       scale 11
  281.       rotate <38, 32, 80>
  282.       translate <62,17,12>
  283.     }
  284.   }
  285. }
  286.  
  287.  
  288.  
  289. //raytracing ends -- reality begins
  290.