// POV-Ray v 3.1 // miriam 8th Nov 2001 // camera 2 meters above the surface // white light // water from Gilles Tran's makecloud2_demo_sea // build 3d cloud layer using layers of 10 hollow spheres 1 km to 2 km up // bluish backdrop sky 10km up (doesn't really get seen) #include "shapes.inc" #include "colors.inc" #include "textures.inc" #include "skies.inc" #include "stars.inc" #include "functions.inc" //--------------------------------------- // Switches //--------------------------------------- #declare RadOK=0; // radiosity off=0/test=1/final=2 //#declare CloudOK=1; // clouds on=1 #declare SeaOK=2; // low-res=0 hi-res=1 very high-res=2 #declare SeaSmoothOK=1; // smooth terrain on=1 #declare PhotonsOK=0; // turns photons on=1 #declare PhotonsReadOK=0; // read previous photons on=1 otherwise save photons //#declare Intervals=4; // cloud media intervals 1 for tests and higher values (2-5) for smoother results //#declare Turbulence=<0.2,0,0.2>;//0.15; // cloud turbulence //#declare Lambda=3; // cloud lambda //#declare Omega=0.6; // cloud omega //#declare Extinction=0.3; // cloud omega //--------------------------------------- // Settings //--------------------------------------- global_settings { assumed_gamma 1 max_trace_level 100 #if (RadOK>=1) radiosity { #if (RadOK=2) count 100 error_bound 0.5 #else count 10 #end recursion_limit 1 low_error_factor .5 gray_threshold 0.0 minimum_reuse 0.015 brightness 0.5 adc_bailout 0.01/2 } #end adc_bailout 0.01/2 #if (PhotonsOK=1) photons { count 2000000 autostop 0 jitter .4 #if (PhotonsReadOK=1) load_file "sea_photons.tmp" #else save_file "sea_photons.tmp" #end } #end } //------------------ // camera //------------------ camera { location <20, 2, 0> direction z up <0.0, 1.0, 0.0> right <4/3, 0.0, 0.0> // look_at <0, 2, 50> angle 90 } //--------------------------------------- // Common stuff //--------------------------------------- #macro GammaColor(Color,Gamma) rgb #end #declare C_Sun=<204,162,124>/255; #declare C_SkyTop=GammaColor(rgb <31,52,159>/255,2); #declare C_SkyTop=rgb <31,52,159>/255; #declare C_SkyBottom=rgb <141,165,255>/255; #declare C_Sand=rgb <105,126,112>/255; #declare C_Sand2=rgb <70,79,61>/255; //#declare C_Cloud=rgb <199,207,255>/255; //#declare C_Cloud=rgb <197,210,255>/255; #declare C_Sea=rgb <62,63,60>/63; #declare C_Sea=rgb <62,64,58>/64; //#declare C_Scattering=C_Cloud*0.013; //#declare C_Absorption=(1-C_Cloud)*0.005; //#declare C_Absorption=0;//(1-White*0.7)*0.003; //#declare C_Emission=C_SkyTop*0.0004; #declare T_Clear=texture{pigment{Clear}finish{ambient 0 diffuse 0}} //------------------- // light //------------------- light_source { <100000, 10000000, 1000> color rgb <1, 1, 1> } //light_source { <100000, 10000000, 1000> color rgb <1, 1, 1> } //light_source { <-6100000, 0, -6100000> color rgb <1, 0.6, 0.6> } //light_source { <0, 6000012, 0> White } //headlight //------------------- // atmospherics //------------------- ////blue sky fog //fog { // distance 30000 // color rgb<0.7, 0.7, 0.9> //} // ////pink mist fog //fog{ // color rgbt<1.7, 0.7, 0.9, 0.8> // fog_type 2 // fog_alt 0.5 // fog_offset 1.6 // distance 10 // turbulence <.2, .2, .2> // //omega 0.35 // //lambda 1.25 // //octaves 5 //} ////light blue fog on the water //fog{ // color rgbt<0.7, 0.7, 0.9, 0.2> // fog_type 2 // fog_alt 0.01 // fog_offset 0.1 // distance 5 // turbulence <.2, .2, .2> // //omega 0.35 // //lambda 1.25 // //octaves 5 //} //Gilles Tran's fog fog{GammaColor(C_SkyBottom,0.3) fog_type 2 distance 500 fog_alt 20 } //--------------------------------------- // Sea //--------------------------------------- #debug "Sea\n" #if (SeaOK=1) #declare Resolution=1000; #else #if (SeaOK=2) #declare Resolution=4000; #else #declare Resolution=300; #end #end #declare SeaBase=height_field{ function Resolution,Resolution { (sin(y*pi*5)+1)/3+f_ridged_mf(x*14, y*30,z, 1.2,3,6,1.18,5,1)*0.55/3 // (sin(y*pi*5)*0.5+sin(x*pi*4)*0.5+1)*0.4+f_ridged_mf(x*7, y*15,z, 1.2,3,6,1.18,5,1)*0.54*0.2 } #if (SeaSmoothOK=1) smooth #end } // seamless tiling // note : there are some artifacts at the jointures - I don't know how ot remove them (merge doesn't work) #declare NX=40; #declare NZ=40; #declare SeaSurface=union{ #declare i=0; #while (i translate x #end #if (mod(i,2)=0) scale <1,1,-1> translate z #end #if (j=19 & i=0) photons { target reflection on refraction off } #end translate x*j+z*i } #declare j=j+1; #end #declare i=i+1; #end // texture{pigment{Red} finish{ambient 0 diffuse 1}} translate -x*NX/2 scale <1/NX,1,1/NZ> } #declare Sea=union{ // surface object{ SeaSurface hollow material { texture{ pigment{rgbf } finish { phong 1//4 phong_size 100 specular 1//2 roughness 0.0005 ambient 0 diffuse 0.2 reflection {0.2,1 fresnel on} conserve_energy } } interior { ior 1.32 fade_distance 0.01 fade_power 2 media {absorption (1-C_Sea)*0.1} } } scale <2000,0.7,2000> } // sea bottom plane{y,0 //rotate x*5 translate y*-3 texture{ pigment{ bozo scale 20 color_map{ [0 GammaColor(C_Sea,2)] [1 GammaColor(C_Sea,2)*0.5] } } finish{ambient 0 diffuse 1} } } // box{<-1000,-1000,0>,<1000,0,1> translate z*500 texture{pigment{C_Sea}finish{ambient 0 diffuse 0}} no_shadow} } //--------------------------------------- // Sea placement //--------------------------------------- // Light group for the non-cloud elements // The light is much brighter than the sun used for the clouds // it also receive light from the cloud light //#declare Transform_Sun=transform{ // rotate x*50 // rotate y*-110 //// rotate y*130 // raise the radiosity brightness to 1 and try with this one! //} //light_group{ // light_source { // -z*100000 // color GammaColor(C_Sun,0.2)*4 // transform{Transform_Sun} // } object{Sea rotate y*25 translate x*3 photons{collect off}} // global_lights on //} //-----------start cloud layers--------------- //series of 10 cloud layers at 10 meter heights //fake cloud texture painted onto hollow sphere sphere { <0, -6000000, 0>, 6001000 hollow on pigment { bozo turbulence 1 octaves 6 omega 0.7 lambda 2 color_map { [0.0 0.1 color rgbt <.85, .85, .85, .5> color rgbt <.75, .75, .75, .5>] [0.1 0.5 color rgbt <.75, .75, .75, .5> color rgbt <1, 1, 1, 1>] [0.5 1.0 color rgbt <1, 1, 1, 1> color rgbt <1, 1, 1, 1>] } scale 2000 } finish { ambient 0.45 diffuse 1.0 reflection 0 } } //fake cloud texture painted onto hollow sphere sphere { <0, -6000000, 0>, 6001010 hollow on pigment { bozo turbulence 1 octaves 6 omega 0.7 lambda 2 color_map { [0.0 0.1 color rgbt <.85, .85, .85, .5> color rgbt <.75, .75, .75, .5>] [0.1 0.5 color rgbt <.75, .75, .75, .5> color rgbt <1, 1, 1, 1>] [0.5 1.0 color rgbt <1, 1, 1, 1> color rgbt <1, 1, 1, 1>] } scale 2000 } finish { ambient 0.5 diffuse 1.0 reflection 0 } } //fake cloud texture painted onto hollow sphere sphere { <0, -6000000, 0>, 6001020 hollow on pigment { bozo turbulence 1 octaves 6 omega 0.7 lambda 2 color_map { [0.0 0.1 color rgbt <.85, .85, .85, .5> color rgbt <.75, .75, .75, .5>] [0.1 0.5 color rgbt <.75, .75, .75, .5> color rgbt <1, 1, 1, 1>] [0.5 1.0 color rgbt <1, 1, 1, 1> color rgbt <1, 1, 1, 1>] } scale 2000 } finish { ambient 0.55 diffuse 1.0 reflection 0 } } //fake cloud texture painted onto hollow sphere sphere { <0, -6000000, 0>, 6001030 hollow on pigment { bozo turbulence 1 octaves 6 omega 0.7 lambda 2 color_map { [0.0 0.1 color rgbt <.85, .85, .85, .5> color rgbt <.75, .75, .75, .5>] [0.1 0.5 color rgbt <.75, .75, .75, .5> color rgbt <1, 1, 1, 1>] [0.5 1.0 color rgbt <1, 1, 1, 1> color rgbt <1, 1, 1, 1>] } scale 2000 } finish { ambient 0.6 diffuse 1.0 reflection 0 } } //fake cloud texture painted onto hollow sphere sphere { <0, -6000000, 0>, 6001040 hollow on pigment { bozo turbulence 1 octaves 6 omega 0.7 lambda 2 color_map { [0.0 0.1 color rgbt <.85, .85, .85, .5> color rgbt <.75, .75, .75, .5>] [0.1 0.5 color rgbt <.75, .75, .75, .5> color rgbt <1, 1, 1, 1>] [0.5 1.0 color rgbt <1, 1, 1, 1> color rgbt <1, 1, 1, 1>] } scale 2000 } finish { ambient 0.65 diffuse 1.0 reflection 0 } } //fake cloud texture painted onto hollow sphere sphere { <0, -6000000, 0>, 6001050 hollow on pigment { bozo turbulence 1 octaves 6 omega 0.7 lambda 2 color_map { [0.0 0.1 color rgbt <.85, .85, .85, .5> color rgbt <.75, .75, .75, .5>] [0.1 0.5 color rgbt <.75, .75, .75, .5> color rgbt <1, 1, 1, 1>] [0.5 1.0 color rgbt <1, 1, 1, 1> color rgbt <1, 1, 1, 1>] } scale 2000 } finish { ambient 0.7 diffuse 1.0 reflection 0 } } //fake cloud texture painted onto hollow sphere sphere { <0, -6000000, 0>, 6001060 hollow on pigment { bozo turbulence 1 octaves 6 omega 0.7 lambda 2 color_map { [0.0 0.1 color rgbt <.85, .85, .85, .5> color rgbt <.75, .75, .75, .5>] [0.1 0.5 color rgbt <.75, .75, .75, .5> color rgbt <1, 1, 1, 1>] [0.5 1.0 color rgbt <1, 1, 1, 1> color rgbt <1, 1, 1, 1>] } scale 2000 } finish { ambient 0.75 diffuse 1.0 reflection 0 } } //fake cloud texture painted onto hollow sphere sphere { <0, -6000000, 0>, 6001070 hollow on pigment { bozo turbulence 1 octaves 6 omega 0.7 lambda 2 color_map { [0.0 0.1 color rgbt <.85, .85, .85, .5> color rgbt <.75, .75, .75, .5>] [0.1 0.5 color rgbt <.75, .75, .75, .5> color rgbt <1, 1, 1, 1>] [0.5 1.0 color rgbt <1, 1, 1, 1> color rgbt <1, 1, 1, 1>] } scale 2000 } finish { ambient 0.8 diffuse 1.0 reflection 0 } } //fake cloud texture painted onto hollow sphere sphere { <0, -6000000, 0>, 6001080 hollow on pigment { bozo turbulence 1 octaves 6 omega 0.7 lambda 2 color_map { [0.0 0.1 color rgbt <.85, .85, .85, .5> color rgbt <.75, .75, .75, .5>] [0.1 0.5 color rgbt <.75, .75, .75, .5> color rgbt <1, 1, 1, 1>] [0.5 1.0 color rgbt <1, 1, 1, 1> color rgbt <1, 1, 1, 1>] } scale 2000 } finish { ambient 0.85 diffuse 1.0 reflection 0 } } //fake cloud texture painted onto hollow sphere sphere { <0, -6000000, 0>, 6001090 hollow on pigment { bozo turbulence 1 octaves 6 omega 0.7 lambda 2 color_map { [0.0 0.1 color rgbt <.85, .85, .85, .5> color rgbt <.75, .75, .75, .5>] [0.1 0.5 color rgbt <.75, .75, .75, .5> color rgbt <1, 1, 1, 1>] [0.5 1.0 color rgbt <1, 1, 1, 1> color rgbt <1, 1, 1, 1>] } scale 2000 } finish { ambient 0.9 diffuse 1.0 reflection 0 } } //--------------end of cloud layers -------------------- /// blue sky 10 km up sphere { <0, -6000000, 0>, 6010000 hollow on pigment { color rgb <0.2, 0.2, 0.5> //translate -1 //color LightBlue //gradient y //color_map { // [0 color Blue] // [5 color White] //} //scale 2 //translate -1 } finish { ambient 1 diffuse 1 reflection 0 } } //// blue sky 11 km up sphere { <0, -6000000, 0>, 6011000 hollow on // texture { // finish { diffuse 0 ambient 1 } pigment { //color Blue //translate -1 color rgb <0.0, 0.0, 0.5> // gradient y // color_map { // [0.0 0.3 color rgbt <0.1, 0.1, 0.6, 0.0>] //Blue // [0.3 0.5 color rgbt <0.8, 0.8, 0.8, 0.5>] //White // } //scale 2 //translate -1 } // } }