/********************************************************************************** Persistence of Vision Ray Tracer Scene Description File File: MH_CloudShell_test.pov Vers: 3.7+ Desc: Media sky based on code by Juha Leppälä (as used originally by Mick Hazelgrove). Some additions by Thomas de Groot (atmospheric haze and comments). Date: Original 2004; adapted November 2020 Auth: Mick Hazelgrove **********************************************************************************/ //+w640 +h640 +a0.3 +am2 +bm2 +bs8 +wt10 #version 3.8; global_settings { assumed_gamma 1.0 } #declare SunColor1 = rgb <0.98, 0.98, 0.95>*7; #declare SunColor2 = rgb <0.98, 0.98, 0.95>*1; //to be used in light_group with dark clouds #declare SunPosition = <0, 0, -2>*10e4; #declare SunDis = vlength(SunPosition)*2/215; //*1/215 #declare Sun1 = light_source { <0, 0, 0> // light's position (translated below) color SunColor1 // light's color translate SunPosition rotate 50*x rotate -140*y parallel point_at <0, 0, 0> } Sun1 #declare Sun2 = light_source { <0, 0, 0> // light's position (translated below) color SunColor2 // light's color translate SunPosition rotate 50*x rotate -140*y parallel point_at <0, 0, 0> } //-------------------------------------------------- #debug "Using Mick Hazelgrove's Clouds...\n" light_group { object {Sun2} // ------------------------------------------------------------------------------- // media sky based on code by Juha Leppälä (as used originally by Mick Hazelgrove) // three concentric cloud shells and an atmospheric haze // ------------------------------------------------------------------------------- #local Debug = on; //-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_- // the macro calculates the aspect of each cloud shell #macro SkyShell(minAlt, maxAlt, Int, Scle, Rot) difference { sphere {< 0, 0, 0>, maxAlt} sphere {< 0, 0, 0>, minAlt} plane {y, 0.0} hollow texture {pigment {color rgbt 1}} scale <100, 1, 100> interior {Int} scale Scle rotate Rot //translate -y*(Radius/2) //this brings the cloudscape down towards the height_field } #end //end macro //-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_- // [1] high clouds, the outer shell of clouds: #declare minAlt = 1000; #declare maxAlt = 2000; #declare Scale = 1; #declare Rot = -30; #declare HC = SkyShell ( minAlt, maxAlt, interior { media { samples 40 intervals 1 //absorption darkens the clouds; use with care or comment out. //absorption rgb <0.30, 0.30, 0.30>*0.0010/Scale //(1a) cloud color. //(1b) the multiplyer controls darkness of the cloud base (smaller is lighter). scattering {1, rgb <0.95, 0.90, 0.85>*0.005/Scale } density { wrinkles warp {turbulence 0.4 lambda 3 omega 0.6} //(2) the density value control the size and crispness/fluffyness of the clouds. //(3) the multiplyer controls the density of the clouds. color_map { [0.000 rgb 0] [0.425 rgb 0] [0.480 rgb 0.5*0.25] [0.650 rgb 0.8*0.25] [0.780 rgb <0.85, 0.85, 0.90>*0.25] [0.900 rgb 0] } scale maxAlt } //density } //media } //int <1.00, 1.00, 1.00>*Scale //Scle i.e. scale <0, Rot, 0> //Rot i.e. rotation ) //---------------------------------------- #if (Debug) #debug "\n Extension of the cloud shells at zenith:\n" #local Min = minAlt; #local Max = maxAlt; #debug concat("\n max_extent high clouds level: ",str(Max, 4,3),"\n") #debug concat(" min_extent high clouds level: ",str(Min, 4,3),"\n") #end HC //======================================== // [2] low, dark cloud, cloud shell just below the preceding one: #declare minAlt = 500; #declare maxAlt = 950; #declare Scale = 1; #declare Rot = -40; #declare LDC = SkyShell ( minAlt, maxAlt, interior { media { samples 25 intervals 1 //absorption darkens the clouds; use with care or comment out. absorption rgb <0.30, 0.30, 0.30>*0.010/Scale //(1a) cloud color. //(1b) the multiplyer controls darkness of the cloud base (smaller is lighter). scattering {1, rgb <0.95, 0.90, 0.85>*0.0035/Scale} density { wrinkles warp {turbulence 0.5 lambda 2.3 omega 0.475 } frequency 1 //(2) the density value control the size and crispness/fluffyness of the clouds. //(3) the multiplyer controls the density of the clouds. color_map { [0.00 rgb 0] [0.55 rgb 0] [0.65 rgb 0.75*0.33] [0.95 rgb 1.5*0.33] [1.00 rgb <1.0, 1.0, 0.7>] } //warp {turbulence 0.5} scale maxAlt } //density } //media } //int <1.00, 1.00, 1.00>*Scale //Scle i.e. scale <0, Rot, 0> //Rot i.e. rotation ) //---------------------------------------- #if (Debug) #local Min = minAlt; #local Max = maxAlt; #debug concat("\n max_extent low, dark clouds level: ",str(Max, 4,3),"\n") #debug concat(" min_extent low, dark clouds level: ",str(Min, 4,3),"\n") #end LDC //======================================== // [3] low scudding, dark clouds, the lowest cloud shell (not used here): #declare minAlt = 300; #declare maxAlt = 400; #declare Scale = 1; #declare Rot = -43; #declare LSDC = SkyShell ( minAlt, maxAlt, interior { media { samples 15 intervals 1 //(1a) cloud color. //(1b) the multiplyer controls darkness of the cloud base (smaller is lighter). scattering {1, rgb <0.0075, 0.0075, 0.007>*2/Scale} density { wrinkles warp { turbulence 0.5 lambda 2.3 omega 0.475 } //(2) the density value control the size and crispness/fluffyness of the clouds. //(3) the multiplyer controls the density of the clouds. color_map { [0.00 rgb 0] [0.65 rgb 0] [0.75 rgb 0.75/3] [0.95 rgb 1.5/3] [1.00 rgb <1.0, 1.0, 0.7>] } scale maxAlt } //density } //media } //int <1.00, 1.00, 1.00>*Scale //Scle i.e. scale <0, Rot, 0> //Rot i.e. rotation ) //---------------------------------------- #if (Debug) #local Min = minAlt; #local Max = maxAlt; #debug concat("\n max_extent low, scudding clouds level: ",str(Max, 4,3),"\n") #debug concat(" min_extent low, scudding clouds level: ",str(Min, 4,3),"\n") #end //LSDC //======================================== // [4] Atmospheric haze below the clouds: #declare minAlt = 0; #declare maxAlt = 100; #declare Scale = 1.0; #declare Rot = 0; #declare AH = difference { sphere {minAlt, maxAlt} plane {y, 0.0} pigment {rgbt 1} scale <100, 1, 100> hollow interior { media { samples 15 intervals 1 scattering {5, rgb <0.90, 0.90, 0.90>*0.0008/Scale eccentricity 0.4 } density { spherical color_map { [0.00 rgb 0] [1.00 rgb 1] } scale <100, maxAlt, 100> } //density } //media } //int scale <1.00, 1.00, 1.00>*Scale //Scle i.e. scale rotate <0, Rot, 0> //Rot i.e. rotation } //) //---------------------------------------- #if (Debug) #local Min = (minAlt); #local Max = (maxAlt); #debug concat("\n max_extent atmospheric haze: ",str(Max, 4,3),"\n") #debug concat(" min_extent atmospheric haze: ",str(Min, 4,3),"\n") #end AH //======================================== } //light_group //=============================================================================================================== //=============================================================================================================== global_settings { radiosity { pretrace_start 0.08 pretrace_end 0.04 count 50, 1000 nearest_count 10, 5 error_bound 1 recursion_limit 1 low_error_factor .3 gray_threshold 0.0 minimum_reuse 0.015 maximum_reuse 0.1 brightness 0.8 adc_bailout 0.01/2 normal off media off always_sample off //max_sample 1.0 } } sphere { 0, 1 hollow pigment { gradient y color_map { [0.0 srgb <215/255, 225/255, 255/255>] [0.7 srgb < 53/255, 79/255, 255/255>] } } finish {emission 1 diffuse 0} scale 3*10e4 } camera { location <0, 2, -20> sky y up y direction z right x*image_width/image_height angle 50 look_at <0, 10, 0> } plane {y, 0.001 pigment {srgb 0.5} normal {granite 0.1 scale 0.001}} cylinder {<0,0,0>,<0,5,0>, 0.25 pigment {srgb <1,0,0>} normal {granite 1 scale 0.001} translate 10*z}