// Packing test render // Hohum 7/4/04 // Run once with rad_data=0, then again with rad_data=1 // For saving and loading radiosity data later on. // i.e. to avoid many artefacts with reflective surfaces // and to avoid repetitive time consuming radiosity traces #declare rad_data=0; //0=save 1=load #declare R1 = seed(0); // You need mlpov to use the hdri sky sphere I've used, plus the publicly available light probe // Otherwise, turn it off. #declare hdri=off; #if (hdri)#version unofficial mlpov 0.83;#end //Read in the position data #declare co=0; #fopen MyFile "positions.txt" read // Read number of points and bounding box size #read(MyFile,c,boxx,boxy) //#debug concat("c is ",str(c,1,0),"\n") #declare xy=array[c][3] #local xy[0][0] = 0; // Read all the x,y, and size data #while(co} } } global_settings{ #if(1) radiosity{ #if(rad_data=0) pretrace_start 16/image_width // start pretrace at this size pretrace_end 2/image_width // end pretrace at this size #else pretrace_start 1 pretrace_end 1 #end count 500 // higher -> higher quality (1..1600) [35] nearest_count 5 // higher -> higher quality (1..10) [5] error_bound .4//1.8 // higher -> smoother, less accurate [1.8] recursion_limit 1 // 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.001 // reuse of old radiosity samples [0.015] brightness 1 // brightness of radiosity effects (0..1) [1] max_sample 3 adc_bailout 0.01/20 normal off // take surface normals into account [off] #if(rad_data=0) save_file "readpos.rad" #else load_file "readpos.rad" always_sample off #end } #end } camera { angle 65 location look_at } // Optional light if no radiosity. #if(0) light_source { 0*x // light's position (translated below) color rgb <1,1,1> // light's color //area_light , <0, 0, boxy>, 2, 2 translate <15, 40, -20>*boxx*boxy } #end // hdri sky or sky sphere gradient map #if(hdri) sphere { 0,4000 pigment { image_map { hdr "beach_probe.hdr" once interpolate 2 map_type 7 } } finish { ambient .3 diffuse 0 } hollow rotate y*180 translate <0,0,0> } #else sky_sphere { pigment { gradient <0,1,0> color_map { [0.00 rgb 0] [0.35 rgb 1] [0.65 rgb 1] [1.00 rgb 0] } scale 2 } } #end plane { y, 0 pigment{rgb <1,1,1>} finish {ambient 0.0 diffuse 1} } #declare co=0; #while(co, xy[co][2]/4, , xy[co][2]/2 #else sphere { xy[co][2]/2 #end // Random pigment, or more x=redder, more y=greener, bigger=bluer //pigment{rgb } pigment{rgb } //reflection multiplied by rad_data value to zero it out during radiosity gathering pass //to avoid artefacts finish{ambient 0 diffuse .8 phong 1 phong_size 250 reflection 0.5*rad_data} //normal{granite 1} } #declare co=co+1; #end