// Remarkably different but inspired by http://brazil.mcneel.com/photos/other/images/792/original.aspx #include "colors.inc" #include "glass.inc" #declare Radiosity=on; #declare Photons=on; global_settings { assumed_gamma 1.0 //max_trace_level 25 #if (Radiosity) radiosity { pretrace_start 0.08 // start pretrace at this size pretrace_end 0.04 // end pretrace at this size count 35 // 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 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(Photons) photons { spacing 0.004 //0.004 // 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 20 // 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 } max_trace_level 10 #end } /* #default { texture { #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 { location <0.0, 3.8, -7> direction 1.5*z right x*image_width/image_height look_at <0.0, 0.0, -0.5> } sky_sphere { pigment { gradient y color_map { [0.0 rgb <0.6,0.7,1.0>] [0.7 rgb <0.0,0.1,0.8>] } } } /* light_source { <0, 0, 0> // light's position (translated below) color rgb <1, 1, 1> // light's color translate <-30, 30, -30> #if(Photons) photons { reflection off refraction on } #end } */ /* light_source { 0*x // light's position (translated below) color rgb <1,1,1> // light's color spotlight // this kind of light source translate <-30, 30, -30> // position of light point_at <1,0.5,1> // direction of spotlight radius 5 // hotspot (inner, in degrees) tightness 50 // tightness of falloff (1...100) lower is softer, higher is tighter falloff 8 // intensity falloff radius (outer, in degrees) #if(Photons) photons { reflection off refraction on } #end } light_source { 0*x // light's position (translated below) color rgb <1,1,1> // light's color spotlight // this kind of light source translate <-30, 30, -30> // position of light point_at <1,0.5,1> // direction of spotlight radius 5 // hotspot (inner, in degrees) tightness 50 // tightness of falloff (1...100) lower is softer, higher is tighter falloff 8 // intensity falloff radius (outer, in degrees) } */ // one with photons light_source { 0*x // light's position (translated below) color rgb <1,1,1> // light's color spotlight // this kind of light source translate <20, 25, 40> // position of light //translate <4, 4, 4> // position of light point_at <1,0.5,1> // direction of spotlight //point_at <0,0,0> // direction of spotlight radius 5 // hotspot (inner, in degrees) tightness 50 // tightness of falloff (1...100) lower is softer, higher is tighter falloff 8 // intensity falloff radius (outer, in degrees) #if(Photons) photons { reflection off refraction on } #end } // one whitout photons light_source { 0*x // light's position (translated below) color rgb <1,1,1> // light's color spotlight // this kind of light source translate <20, 25, 40> // position of light point_at <1,0.5,1> // direction of spotlight //point_at <0,0,0> // direction of spotlight radius 5 // hotspot (inner, in degrees) tightness 50 // tightness of falloff (1...100) lower is softer, higher is tighter falloff 8 // intensity falloff radius (outer, in degrees) } /* light_source { 0*x // light's position (translated below) color rgb <1,1,1> // light's color spotlight // this kind of light source translate <-20, 25, 40> // position of light point_at <1,0.5,1> // direction of spotlight radius 5 // hotspot (inner, in degrees) tightness 50 // tightness of falloff (1...100) lower is softer, higher is tighter falloff 8 // intensity falloff radius (outer, in degrees) #if(Photons) photons { reflection off refraction on } #end } light_source { 0*x // light's position (translated below) color rgb <1,1,1> // light's color spotlight // this kind of light source translate <-20, 25, 40> // position of light point_at <1,0.5,1> // direction of spotlight radius 5 // hotspot (inner, in degrees) tightness 50 // tightness of falloff (1...100) lower is softer, higher is tighter falloff 8 // intensity falloff radius (outer, in degrees) } */ // ---------------------------------------- #declare t_2=texture { pigment { average pigment_map { [1.0 rgb <1,0.8,0.8>] [2.0 rgb <1,1,1>] } } normal{ average normal_map{ [1.0 bumps 0.1 ] [2.0 agate] [4.0 bumps 0.1 ] } } finish{diffuse 1.3 phong .1} } #declare t_3=texture { pigment { average pigment_map { [1.0 rgb <1,0.8,0.8>] [2.0 rgb <1,1,1>] } } normal{ average normal_map{ [1.0 bumps 0.1] [2.0 bumps 0.4 rotate 60 scale .015] [4.0 bumps 0.2 rotate 120 scale .005] } } #if (!Radiosity) finish{diffuse 1.3 phong .1} #end } /* #declare t_3=texture { pigment { color rgb <1,1,1> } } */ #declare t_marble_1=texture { pigment{ marble color_map{ [0.1 rgb <1,0.8,0.8>] [0.5 rgb <1,0.8,0.8>] [0.5 rgbt <0.8,0.8,1,1>] } } scale 0.2 rotate 90*z } #declare t_glass_sphere=T_Beerbottle_Glass; #declare t_glass_sphere=T_Green_Glass; #declare t_glass_sphere=T_Glass3; #declare t_glass_sphere=texture { pigment { color rgbf <0.8, 1, 0.95, 0.95> } //pigment { color rgbft 1 } finish { F_Glass3 } } #declare i_glass_sphere=interior { ior 1.5 fade_distance 1.0 fade_power 2 media { absorption <0.8, 0.6, 1.0, 0.5> } } #declare i_glass_marble=interior { ior 1.5 fade_distance 1.0 fade_power 2 /* ior 1.5 fade_distance 2.0 fade_power 1001 */ //fade_color rgb <1,0,0> media { //absorption 1 absorption <0.8, 0.6, 1.0, 0.5> } } // ---------------------------------------- #declare flat_torus=intersection { torus {2 0.2} box {<-2.4,-0.15,-2.4> <2.4,0.15,2.4>} } // ---------------------------------------- #declare n_glass=normal{ //bumps 0.8 agate } #declare dist=0.001; plane { <0,1,0>, -1 texture { t_3} } // Sphere ----------------------------------------- difference { sphere { 0.0, 1 } sphere { 0.0, 1-dist/2 } texture {t_marble_1 normal{n_glass}} interior {i_glass_marble} #if(Photons) photons { target reflection off refraction on collect on //off } #end translate <1,0.5,1> } difference { sphere { 0.0, 1-dist } sphere { 0.0, 1-dist*2 } // texture {T_Beerbottle_Glass} // interior {I_Glass} texture {t_glass_sphere normal{n_glass}} interior {i_glass_sphere} #if(Photons) photons { target reflection off refraction on collect on //off } #end translate <1,0.5,1> } // Torus --------------------------------------- difference { intersection { torus {2 0.3} box {<-2.4,-0.15,-2.4> <2.4,0.15,2.4>} } intersection { torus {2 0.3-dist} box {<-2.4,-0.15+dist,-2.4> <2.4,0.15-dist,2.4>} } texture { t_marble_1 scale 0.4 rotate 30 normal{n_glass}} interior {i_glass_marble} #if(Photons) photons { target reflection off refraction on collect on //off } #end translate <0,-0.8,0> } difference { intersection { torus {2 0.3-dist} box {<-2.4,-0.15+dist,-2.4> <2.4,0.15-dist,2.4>} } intersection { torus {2 0.3-dist*2} box {<-2.4,-0.15+dist*2,-2.4> <2.4,0.15-dist*2,2.4>} } texture {T_Orange_Glass normal{n_glass}} interior {i_glass_sphere} #if(Photons) photons { target reflection off refraction on collect on //off } #end translate <0,-0.8,0> } // Cylinder ----------------------------------- cylinder { <0.1,0.15-dist+0.2-0.8,-2.5>, <-3,0.15-dist+0.2-0.8,2>,0.2 texture { t_marble_1 scale 0.6 rotate 60 normal{n_glass}} //no_shadow interior {i_glass_marble} #if(Photons) photons { target reflection off refraction on collect on //off } #end } difference { cylinder { <0.1-dist,0.15-dist+0.2-0.8,-2.5+dist>, <-3+dist,0.15-dist+0.2-0.8,2-dist>,0.2-dist } cylinder { <0.1-dist*2,0.15-dist*2+0.2-0.8,-2.5+dist*2>, <-3+dist*2,0.15-dist*2+0.2-0.8,2-dist*2>,0.2-dist*2 } texture {T_Yellow_Glass normal{n_glass}} interior {i_glass_sphere} #if(Photons) photons { target reflection off refraction on collect on //off } #end }