#version 3.5; // +a0.2 +am2 +fn +k0.4 #declare tree=true; #declare mediasky=false; #declare warninggiven=false; #macro linear2sine(X) #if((X<0 | X>1) & !warninggiven) #warning "#macro linear2sine: argument X out of Range [0...1]\n" #declare warninggiven=true; #end (sin(X*pi-pi/2)+1)*.5 #end #declare stereosep=0; //0...N #declare stereomode=1; // 1/-1 #declare c=clock; //clock global_settings { assumed_gamma 2.5 max_trace_level 15 } camera { location <0,2*1.8,-4.7> look_at <0,2.5*1.1,0> //angle 120 angle 90 translate x*stereosep/2*stereomode rotate y*90*linear2sine(c) } #include "functions.inc" #if(!mediasky) /*QuicknDirty Sky for Previews*/ sphere { 0,1 hollow no_shadow texture { pigment { gradient y color_map { [0.0 color rgb <1,.9,.6>*2 transmit .5] [0.25 color rgb <1,.9,.6>+<.2,.3,.6> transmit .5] [0.9 color rgb <.2,.3,.6>*2 transmit .5] } } finish{ambient 1 diffuse 0} } texture { pigment { function{f_wrinkles(x*4,y*3*4,z*4)*y^.7} color_map { [0.0 color rgb 1 transmit 1] [1.0 color rgb 1 transmit .7] } scale 2 } finish{ambient 1 diffuse 0} } scale 600 } fog { fog_type 2 color rgb <232,224,172>/255*0.9 fog_offset 0 fog_alt 3 distance 20 } #else /* Athmosphere */ sphere { 0,1 hollow //no_shadow pigment{color rgbt 1} interior { media { //method 1 aa_level 6 //aa_threshold .02 variance 1.0/256 confidence .8 scattering{5,color rgb <.4,.5,1>*.01*2*5 extinction .7 eccentricity .1} density { spherical color_map { [0.0 color rgb 0] [0.92 color rgb 1] [0.9 color rgb 0] [1.0 color rgb 0] } } } } scale 1000/5 scale <1,.1,1> } /* Clouds */ sphere { <0,0,0>,1 hollow no_shadow texture { pigment { wrinkles color_map { [0.0 color rgb 1 transmit 1] [1.0 color rgb 1 transmit .75] } scale .075 } finish { diffuse .5 ambient .5 } } scale 1000/(5*1.1) scale <1,.1,1> } #end /* Ring-Planet */ #include "ringplanet.inc" object { ringplanet(150) rotate x*80 rotate -z*20 translate z*1500 rotate -x*10 rotate y*10 } light_source { <1,2,-2>*1500*10 color rgb 1 media_interaction on media_attenuation on } /* Normal for plane */ #declare p= function { pigment { function{min(abs(sin(x*pi/2)),abs(sin(z*pi/2)))} color_map { [0.0 color rgb 0] [0.1 color rgb 1] [1.0 color rgb 1] } } } #declare n1= normal { function{p(x,y,z).gray} scale .5 } #macro eval_pigment2(pigm, vec) #local fn = function { pigment { pigm } } #local result = (fn(vec.x, vec.y, vec.z).gray); result #end /* macro for irregularies in plane */ #macro planedisp(rad,h_max,k) #local h_threshold=.1; #local d=.001*<1,1,1>; #local Sbox=seed(1); #local i=-rad; #while(i/rad)); #local h= eval_pigment2(pigment{wrinkles scale .3},) *h_max*max(0,(1-vlength(/rad)))^2; #if(h>h_threshold) box { <0,0,0>+d,<1,h,1>-d translate } #end #local j=j+1;#end #local i=i+1;#end #end /* Plane */ union { plane { y,0 } union { planedisp(5,.75,5) translate <6,0,-2> } union { planedisp(20,1.5,0) translate <6,0,2>*4+<1,0,-1>*8 } //union{planedisp(4,5,4)translate <-15,0,40>} pigment{checker color rgb .2, color rgb 1 scale <1,100,1>} finish { reflection .5 specular 1 roughness .02 } normal{n1 .4} } /* Tree macro*/ #declare S=seed(2); #macro a(n,D,dD,rx,ry) union { sphere{0,D} cone { 0,D,y,max(0,D-dD) } #if(n>0 & D-dD>0) #local i=0; #while(i<4) object { a(n-1,D-dD,dD,90*linear2sine(c),i*360/4) translate y*1 } #local i=i+1; #end #else sphere{y,D*1.5 texture{pigment{color rgb <.5,.475,.3>} finish{reflection{1 metallic} specular 2 roughness .02 metallic}}} #end rotate y*n*(45*(1-c)) rotate x*rx rotate y*ry } #end /* Tree */ union { cone{0,.1+.02,y,.1} #if(tree)object{a(4,.1,.02,0,0) translate y}#end pigment{color rgb .5} finish { specular 1 roughness .02 reflection .8 } }