// Persistence of Vision Ray Tracer Scene Description File // File: 3D_Mosaic_1.pov // Vers: 3.5 // Desc: 3DMosaic-Macro Test with radiosity lighting // Date: 29.12.2001 // Auth: Thies Heidecke [h3idi@gmx.net] #version 3.5; #declare smooth_lighting=off; #declare radiosity_lighting=off; #declare photon_caustics=off; #declare centerlight=off; #declare foo = function{1}; global_settings { max_trace_level 6 #if(radiosity_lighting=on) radiosity { pretrace_start 0.08 // start pretrace at this size pretrace_end 0.04 // end pretrace at this size count 300 // higher -> higher quality (1..1600) [35] nearest_count 5 // higher -> higher quality (1..10) [5] error_bound 0.8 // 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] //save_file "file_name" // save radiosity data //load_file "file_name" // load saved radiosity data //always_sample off // turn sampling in final trace off [on] //max_sample 1.0 // maximum brightness of samples } #end #if(photon_caustics=on) photons { spacing 0.008 // specify the density of photons //count 100000 // alternatively use a total number of photons //gather min, max // amount of photons gathered during render [20, 100] //media max_steps [,factor] // media photons //jitter 1.0 // jitter phor photon rays //max_trace_level 5 // optional separate max_trace_level //adc_bailout 1/255 // see global adc_bailout //save_file "filename" // save photons to file //load_file "filename" // load photons from file //autostop 0 // photon autostop option //radius 10 // manually specified search radius // (---Adaptive Search Radius---) //steps 1 //expand_thresholds 0.2, 40 } #end } camera { location <2.7, 1.6, -2.5> right x*image_width/image_height look_at <0.0, 0.0, 0.0> } //* light_source { 0*x #if(radiosity_lighting=on) color rgb 0.35 #else color rgb 1 #end #if(smooth_lighting=on) area_light #if(centerlight=on) <.15, 0, 0> <0, 0, .15> #else <1, 0, 0> <0, 0, 1> #end 7, 7 // total number of lights in grid (4x*4z = 16 lights) adaptive 3 // 0,1,2,3... //jitter // adds random softening of light circular // make the shape of the light circular orient // orient light #end #if(photon_caustics=on) photons { refraction on reflection on //#if(smooth_lighting=on) //area_light //#end } #end #declare lpos = 0.99*(<6, 6, 0>+1*<-1,-1,0>); fade_power 2 #if(centerlight=on) fade_distance 2.5 #else fade_distance vlength(lpos)-1 translate lpos #end } //*/ #default { texture { pigment { color rgb 1 } finish{ ambient 0.0 diffuse 0.8 phong 0.3 phong_size 3 } } } #declare ISO = object { #local a = sqrt(2)-1;//0.318;// #local aa = a*a; isosurface { function { (x*x-aa)*(x*x-1) + (y*y-aa)*(y*y-1) + (z*z-aa)*(z*z-1) } contained_by { box { -1.15, 1.15 } } //threshold 0.0 accuracy 0.005 max_gradient 7//13.5 max_trace 3 } } #declare glass = texture { pigment { color rgbf <0.97, 0.99, 0.98, 0.94> } finish { specular 0.7 roughness 0.001 ambient 0 diffuse 0 reflection { 0.2, 0.97 fresnel on } conserve_energy } } #declare metal = texture { pigment { color rgb <0.51, 0.5, 0.55> } finish { specular 0.4 roughness 0.001 ambient 0 diffuse 0.3 reflection { 0.8 //fresnel on metallic } //irid { // .5 // thickness 5.0 //} } } #declare marbletex = texture { pigment { average pigment_map { [2 granite scale 3 color_map{[0.0 color rgb 0.5][1.0 color rgb 1.0]}] [1 granite scale 1 color_map{[0.0 color rgb 0.5][1.0 color rgb 1.0]}] } } finish { ambient 0.0 diffuse 0.9 //reflection { // 0.1, 0.3 //} } } #declare bottom=-vlength(trace(ISO,<-1,-5,-1>,y)); /* cone { <-2,bottom,-5>, 0.1, <-2,bottom,4>, 0.6 finish{ ambient 7 } photons{collect off} no_shadow } */ //* cone { <2.3,bottom,0.5>, 0.2, <2.3,6,0.5>, 0.1 finish{ ambient 7 } photons{collect off} no_shadow } //*/ box { <-2,bottom,-5>,<6,6,4> hollow pigment { checker color rgb 1 color rgb <0.4,0.2,0.01> turbulence 0.0015 translate bottom*y } } // Macro fpr making a 3d-Mosaic in the area of a bounding-box A,B. N parts per axis, each with M Samples in each axis // this leads to (N*M)^3 Samples being taken and a maximum of N^3 objects // good values for M are 2,3,4 . M=3 e.g. leads to 27 samples per cube #macro Mosaic(A, B, Obj, N, M) #local cx=0; // loop-counter #local cy=0; #local cz=0; #local mx=0; #local my=0; #local mz=0; #local D=<0,0,0>+(B-A)/N; // Difference between two cubes #local P=<0,0,0>+A; // Start-coordinates #local insrat=0; // inside ratio #while (cx0) & (insrat0) // use this if statement instead if you want the inside of the object filled #local insrat = insrat / M^3; // choose the object which is used as element of the whole //sphere{ (P+.5*D), insrat*.5*sqrt(1/3)*vlength(D) } //box{ P+.5*(1-pow(insrat,1/3))*D, P+.5*(1+pow(insrat,1/3))*D } //superellipsoid { <.1,.1> scale .5*pow(insrat,1/3)*D translate P+.5*D} superellipsoid { (1-.99*insrat)*<1,1> scale .5*pow(insrat,1/3)*D translate P+.5*D} #end #local P = P + D.z*z; #local cz = cz + 1; #end #local cz = 0; #local P = P + D.y*y; #local P = P - (N*D.z)*z; #local cy = cy + 1; #end #local cy = 0; #local P = P + D.x*x; #local P = P - (N*D.y)*y; #local cx = cx + 1; #end #end union { // these are low-detail-settings for faster parsing, if u want more detail=more cubes/more precision // use something like this instead: // Mosaic(<-1.15,-1.15,-1.15>, <1.15,1.15,1.15>, ISO, 51, 4) // but expect long parse-times Mosaic(<-1.15,-1.15,-1.15>, <1.15,1.15,1.15>, ISO, 9, 3) texture { metal } //texture { glass } #if(photon_caustics=on) photons{ target //reflection on refraction on collect off } #end /* interior { ior 1.5 fade_distance 1.0 fade_power 2 } */ } /* // looks interesting imo intersection { union { Mosaic(<-1.15,-1.15,-1.15>, <1.15,1.15,1.15>, ISO, 9, 3) } object{ ISO } texture{ metal } } */