// Persistence of Vision Ray Tracer Scene Description File // File: mediarad.pov // Vers: 3.6 // Desc: Exercise with radiosity and media, in order to make an acceptable wax material. // Date: Set 2007 // Auth: Bruno Cabasson #include "colors.inc" #include "shapes.inc" #declare RADIOSITY = yes; #declare NB_RADIOSITY_LIGHTS = 20; global_settings { assumed_gamma 1.0 max_trace_level 15 #if (RADIOSITY) radiosity { pretrace_start 0.08 // start pretrace at this size pretrace_end 0.01 // end pretrace at this size count 50 // higher -> higher quality (1..1600) [35] nearest_count 7 // higher -> higher quality (1..10) [5] error_bound 0.5 // higher -> smoother, less accurate [1.8] recursion_limit 3 // how much interreflections are calculated (1..5+) [3] low_error_factor .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] } #end } #default { texture { pigment {rgb 1} #if (RADIOSITY) finish { ambient 0.0 diffuse 0.6 specular 0.3 } #else finish { ambient 0.1 diffuse 0.6 specular 0.3 } #end } } // ---------------------------------------- camera { right x*image_width/image_height angle 50 location 0 look_at z rotate 10*x translate <0,0.5,-4> } // The dome that lits the scene by radiosity #declare O_Dome = sphere { 0, 10000 hollow pigment { gradient x translate -x/2 scale 20000 color_map { [0.5 Green] [0.5 Blue] } } finish {diffuse 0 ambient 1} } // ---------------------------------------- // The density function that gives some granumarity to the wax #declare D_Wax = density { bozo scale 0.015 //spherical scale 0.5 turbulence 0.3 color_map { [0 rgb 0.5] [0.7 rgb 1] } } // The media (wax) #declare M_BoxMedia = media { method 3 intervals 1 samples 10 scattering {1, 4 extinction 1} absorption 2 density {D_Wax} } // The box with wax inside #declare O_Box = object { #local D = <0.5, 0.5, 0.5>; Round_Box_Merge (-D, D, 0.025) hollow pigment {rgbt 1} // Normal for the surface normal { average normal_map { [3 bozo 0.15 scale 0.2] [1 granite 1 scale 0.05] } } finish {specular 0.05 roughness 0.03} interior { ior 1.25 media {M_BoxMedia} } } // The is a metallic ball in the middle of the box #declare O_BallBox = union { object {O_Box} sphere {0, 0.15 pigment {rgb 0.2} finish {specular 0.3 roughness 0.05}} } // The red light_source, common to the environment and the box. But ot does not have to lit twice => in the 2 light_groups separately. #declare LS_RedLight = light_source { 0 Red fade_distance 100 fade_power 3 looks_like {sphere {0, 0.2 pigment {Red} finish {diffuse 0 ambient 2}}} translate 4*z rotate -8*x + 20*y } // Some decoration spheres to illustrate the radiosity effect of the dome and the red light_source #declare N = 15; #declare i=0; #while (i