// Persistence of Vision Ray Tracer Scene Description File // File: mtn_clouds.pov // Vers: MegaPOV 0.3 // Desc: Media clouds over terrain. // Date: Jan. 22, 2000 // Auth: Abe Madey global_settings { max_trace_level 15 } //This is to avoid any problems with "flare" discs // General scene controls. #declare Haze_on = true; #declare Clouds_on = true; #declare hf = //declare the hf to use with the trace function for camera placement height_field { png "mtn.png" smooth translate <-.5, 0, -.5> scale <10, .8, 10> } #declare cam_loc = trace (hf, <-1, 100, -4>, -y)+.05*y; #declare cam_la = <2, 1.1, 0> //look_at point declared for use later in aligning the sun flare. camera { location cam_loc direction z look_at cam_la angle 60 } //this is a very basic sky and might warrent some modification (i.e. a lightening towards the horizon) sky_sphere{pigment {color rgb <.4, .35, 1>}} disc{ //this is the disc for the sun flare 0, (<100,100,200>-cam_loc), 1 hollow pigment {spherical color_map{[0, rgbf 1][1 rgb <1,1,.9>*1.1 filter .1]} poly_wave 2} finish{ambient 1} no_shadow scale .04 translate cam_loc+ .0001*(<100,100,200>-cam_loc)//not very robust, but it works here. } // Lights are grouped separately where "B" is used for the clouds only and "A" for everything else. // I found this gives me better control over the final appearance of the scattering media. light_source{<100, 100, 200> color rgb 1.6 groups "A"} light_source{<100, 100, 200> color rgb 1 groups "B"} // The objective here is to produce a haze which tints distant objects with a bluish hue and generally // becomes lighter with distance. However, with no extinction, an infinate haze would become white in the // far distance. The solution used here is somewhat ad hoc and I am not sure I would consider making // a regular practice of it. Essentially it uses a squashed sphere to contain the media. Changing the // vertical (y) and horizontal scaling controls how "thick" the haze gets in the distance vs. overhead. // It probably should have its own light group. #if (Haze_on) sky_sphere{pigment{color rgb <.4, .35, 1>}} sphere { 0, 10 hollow scale <.8, .1, .8> pigment{rgbt 1} interior { media{scattering{1, rgb <.2, .25, 1>*.2 extinction 0} method 3 samples 2,2 intervals 2 light_group "A"} } } #end // In my experience using the procedural textures in pov to create clouds is a sort like taking photos of // clouds: if you see a good one, take it! // // The media quality settings here are just borderline, so as to // keep render times down a bit. Setting aa_level to 8 or 9, aa_threshold .07 and intervals to 6 or 7 // might still improve the quality. Note that these clouds are not casting shadows on the landscape // with this light group arrangement. #if (Clouds_on) box { <-50, 1, -50>, <50, 1.5 ,50> hollow pigment{rgbt 1} interior{ media { method 3 light_group "B" aa_level 7 aa_threshold .1 samples 1,10 //note: the max sample value of 10 is not necessary here with method 3 intervals 5 scattering {5 color rgb 3 extinction .7 eccentricity .1} density{ granite color_map{ [.5 color rgb 0] [.53 color rgb 1] //to give a little softness to the cloud edges. This could be fiddled with. } #declare scale_val = 8; //this is also a good parameter to fiddle with (it affects the turbulence scale). scale scale_val warp{turbulence .4 lambda 3} scale 1/scale_val scale 12 } } } } #else sky_sphere {pigment{gradient y color_map{[0 color rgb .7][1 color blue 1]}}} //just an alternative sky #end // Landscape code beyond this point #macro Grass_Rock (Ratio, Fuzzy)//Fuzzy controls the amount of blending between the two granite color_map { [Ratio-.5*Fuzzy rgb <0.4375, 0.66406, 0.20703>] //grass color [Ratio+.5*Fuzzy rgb <0.52734, 0.50391, 0.55859>] //rock color } scale .05 turbulence .2 lambda 3 octaves 6 #end // This is a very simple texture. It seems to work OK at resolutions up to 640x480, but may be too // "plain" above that. Probably could use some work. #declare Landscape_texture = texture{ pigment{ slope -y pigment_map{ [0 Grass_Rock (.8, .03)] //flatter terrain [.05 Grass_Rock (.1, .03)] //sloped terrain } } normal{ //not really sure how effective this normal statement is. Probably could be tuned. slope -y normal_map{ [0 granite bump_size .05] //flatter terrain [.05 granite bump_size .5] //sloped terrain } } } object { hf light_group "A" texture{Landscape_texture} }