//green northern lights //by Kurt Bangert bangert@travelnotes.de global_settings { max_trace_level 50 } #include "colors.inc" #include "textures.inc" #include "cabin.inc" //background {<0,0,.1>} camera {location <0,2.5,-40> look_at <0,2.5,0>} light_source { <2, 20, -40> color rgb <.1,.2,.1> } #declare none = pigment {color rgbt <1,1,1,1>} //green light one #declare green_light1= media { emission .5 intervals 10 samples 1, 10 confidence 0.9999 variance 1/1000 density { gradient y turbulence <1,.7,1> scale <.9,3,1> color_map { [0.0 color rgb <0, 0,0>] [0.25 color rgb <0, 0,0>] [0.3 color rgb <0, 1, 0>] [0.5 color rgb <0, .4, 0>] [1.0 color rgb <0, 0,0>] }}} //green light two #declare green_light2= media { emission .4 intervals 10 samples 1, 10 confidence 0.9999 variance 1/1000 density { gradient y turbulence <1,.7,1> omega .8 scale <1,20,1> color_map { [0.0 color rgb <0, 0, 0>] [0.2 color rgb <0, 0, 0>] [0.3 color rgb <0, 1, 0>] [0.5 color rgb <0, .4,0>] [1.0 color rgb <0, 0, 0>] }}} //distant fog texture #declare fogtexture=texture{ pigment{ gradient y color_map { [0.0 color rgbt <.1,0,0, 0>] [0.1 color rgbt <.1,0,0, 0>] [0.15 color rgbt <.1,0,0, .5>] [0.2 color rgbt <.1,0,0, 1>] [0.5 color rgbt <.1,0,0, 1>] [1.0 color rgbt <.1,0,0, 1>] }}} //not a sunset, but just the last bit of daylight #declare sunsetmedia=media{ emission .12 intervals 10 samples 1, 10 confidence 0.9999 variance 1/1000 density { gradient y color_map { [0.0 color rgb <.5, .5, .5 >] [0.15 color rgb <.3, .3, .3 >] [0.25 color rgb <.1,.1,.1>] [0.3 color rgb < 0, 0, .07>] [1.0 color rgb < 0, 0, .07>] }}} #declare element1= difference { cone {<0,0,0> 4 <0,1,0> 5} cylinder {<0,-0.1,0> <0,1.1,0> 4. scale x*1.25} box{<-6,-0.2,-6><6,1.2,0>} } #declare element2= difference { cylinder {<0,0,0> <0,1,0> 5} cylinder {<0,-0.1,0> <0,1.1,0> 4. scale x*1.25} box{<-6,-0.2,-6><6,1.2,0>} // cylinder {<-5,0,0><-5,1.3,0> 1} } #declare curtain1= union { //small one in the foreground //scale 5 translate 5 rotate z*19 object {element1 hollow scale <5,43,1> rotate y*20 rotate z*25 translate <5,-13.5,0> interior {media{green_light1 rotate z*20 scale <40,65,40> translate <5,-8,0>}}} //larger one in the background object {element2 hollow scale <30,42,0.5> rotate y*10 rotate -z*10 translate <0,-16,0> interior {media{green_light2 rotate z*10 scale <160,160,20> translate <8,-35,14>}}} } //background stars #declare r = seed(1); #declare i=0; #while (i<1000) object {sphere{ rand(r)*0.2 pigment {White} finish {Luminous} }} #declare i=i+1; #end //the last bit of daylight at the horizon object{box{<-200,0,100><200,200,104> }hollow interior {media{sunsetmedia scale y*230 translate -y*15}} pigment {none}translate -y*42 } //attenuate the starlight near the horizon object{box{<-200,0,105><200,200,109>} texture {fogtexture scale y*260 translate -y*15} translate -y*50} object {curtain1 pigment {none}} object {height_field { tga "berg.tga" smooth scale <50,9,30> translate<-25,-1.2,-60> } pigment {White}} object {cabin scale 0.05 rotate <0,10,0> translate <2.1,-.38,-32>}