/********************************************************************************** Persistence of Vision Ray Tracer Scene Description File File name : 00-MediaTree_test.pov Version : 3.8 Description : A media tree as proposed by Gilles Tran in MakeClouds. Can be used as vegetation on a background landscape. Author : Gilles Tran Date : 2003 Updated : Thomas de Groot (2021) **********************************************************************************/ //+w1000 +h460 +a0.3 +am2 +bm2 +bs8 +wt7 //+w1000 +h460 +am3 +a0.01 +ac0.90 +r3 +wt7 #version 3.8; //-------------------------------------------------------------------------- //#include "colors.inc" //#include "textures.inc" //#include "glass.inc" //#include "metals.inc" //#include "golds.inc" //#include "stones.inc" //#include "woods.inc" //#include "shapes.inc" //#include "shapes2.inc" //#include "functions.inc" //#include "math.inc" //#include "transforms.inc" #include "rand.inc" global_settings { assumed_gamma 1.0 radiosity { pretrace_start 0.08 // start pretrace at this size pretrace_end 0.01 // end pretrace at this size count 10, 100 // higher -> higher quality (1..1600) [35] nearest_count 5 // higher -> higher quality (1..10) [5] error_bound 1.8 // higher -> smoother, less accurate [1.8] recursion_limit 2 // how much interreflections are calculated (1..5+) [3] low_error_factor 0.5 // reduce error_bound during last pretrace step gray_threshold 0.0 // increase for weakening colors (0..1) [0] minimum_reuse 0.015 // reuse of old radiosity samples [0.015] brightness 1 // brightness of radiosity effects (0..1) [1] adc_bailout 0.01/2 normal on // take surface normals into account [off] media on // take media into account [off] always_sample off // turn sampling in final trace off [off] //max_sample 1.0 // maximum brightness of samples } } //-------------------------------------------------------------------------- // camera ------------------------------------------------------------------ #declare Camera_0 = camera { location <10.0 , 50 , -150.0> right x*image_width/image_height angle 75 look_at <0.0 , 10 , 0.0> } camera{Camera_0} // sun --------------------------------------------------------------------- #local SunCol = srgb <0.9, 0.9, 0.8>; light_source {<-500, 1000, -1500> SunCol*3} // sky --------------------------------------------------------------------- sphere { 0, 1 hollow pigment { gradient <0, 1, 0> color_map { [0.00 srgb <0.98, 0.98, 0.98>] [0.30 srgb <0.00, 0.10, 0.98>] [0.70 srgb <0.00, 0.10, 0.98>] [1.00 srgb <0.98, 0.98, 0.98>] } scale 2 } finish { emission 1 diffuse 0 } scale 10e4 } //-------------------------------------------------------------------------- //---------------------------- objects in scene ---------------------------- //-------------------------------------------------------------------------- #macro Tree(rd_) // creates a media-filled sphere that looks like a tree #local R1 = rd_; #local R2 = RRand(0.0, 1.0, R1); #if (R1 < 0.2) // yellowish #local C_Media = /255; #else // blueish #local C_Media = /255; #end sphere {0, 1 //scale //scale texture {pigment {rgb 1 transmit 1} finish {diffuse 1.0}} hollow interior { media { scattering {1, C_Media*0.05} absorption (1-C_Media*RRand(0.5, 0.9, R1)) samples 1 density { spherical density_map { [0.3 rgb 0.0] [0.3 rgb 0.1] [0.4 rgb 0.7] [0.5 rgb 0.9] [0.6 rgb 0.8] [0.8 rgb 1.0] } warp { turbulence RRand(0.1, 0.5, R1) lambda 5.5+RRand(1, 5, R1) } } } } scale RRand(2, 5, R1) scale RRand(<3, 5, 3>, <5, 15, 5>, R1) rotate RRand(-180, 180, R1)*y translate RRand(10, 15, R1)*y } #end #declare rd = seed(749382); //object { Tree(rd) } #declare Terrain = plane {y, 0 pigment {srgb <0.5, 0.6, 0.1>} normal {granite 1 scale 0.01} finish {diffuse 0.7}} Terrain #declare Woods = union { #declare i = 0; #while (i<3000) #declare Start = VRand_In_Box(<-2500,1000,-250>, <2500, 1001, 5000>, rd); #declare Norm = <0,0,0>; #declare SC = rand(rd)+1; #declare Inter = trace (Terrain, Start, -y, Norm); #if (vlength(Norm) != 0 /*& Inter.y > 520*/) #if (rand(rd) < 0.2) #declare j = 0; #declare Start0 = Start; #while (j < 20+rand(rd)*20) #if (rand(rd) < 0.5) // lines of trees #declare Dir = *(1+rand(rd))*4; #declare Start = Start+Dir; #else // groves and thickets #declare Start = vaxis_rotate((1+rand(rd))*20, y, 360*rand(rd))+Start0; #end #declare Norm = <0,0,0>; #declare Inter = trace (Terrain, Start, -y, Norm); #if (vlength(Norm) != 0 /*& Inter.y > 520*/) object {Tree(0) translate Inter} #end #declare j = j+1; #end //of while #else // single tree object {Tree(0) translate Inter} #end // //cylinder {0, <0, 10, 0>, 0.1 pigment {rgb <0.8, 0.5, 0.4>} translate Inter} //treetrunk #end #declare i = i+1; #end scale 0.5 } object {Woods translate 10*z}