//hdr test //using HDR maps from http://unparent.com/ #version unofficial megapov 1.21; #include "rad_def.inc" #include "transforms.inc" #declare rad=on; #declare lights=on; //better sampling of dome than radiosity will do, plus specular highlights work! #declare dome = pigment { image_map { //hdr "hdr/FINAL_outside.hdr" //hdr "hdr/probe_frontYard_FINAL.hdr" hdr "hdr/probe_parkSun_FINAL.hdr" //hdr "hdr/beverlyHills_sun_probe_FINAL.hdr" //hdr "hdr/probe_beverlyHills_shade_FINAL.hdr" map_type 7 interpolate 2 } } global_settings { assumed_gamma 1 #if (rad) radiosity { Rad_Settings(Radiosity_Fast,on,on) } #end tone_mapping { //exposure control function { min(x*.5,1) } //clamp colours for AA } } #declare signpow = function(x,p) { pow(abs(x),p-1)*x } //make lights #if (lights) #local num_lights = 100; #local blurang = 10; //degrees #local blursamp = 20; #local f_samp = function { pigment { dome } }; #local rs = seed(14); #local rs2 = seed(21); #local i = 0; #while (i < num_lights) #local j=i/num_lights; #local dir = vrotate(z,);//vrotate(z,); //average together several samples in the region #local col=<0,0,0>; #local s=0; #while ( s < blursamp ) #local dir2 = vrotate(z,); #local trans = transform { Reorient_Trans(z,dir) }; #local dir2 = vtransform(dir2, trans); #local samp = f_samp(dir2.x,dir2.y,dir2.z); #local s=s+1; #local col = col*(s-1)/s + samp/s; #end light_source { dir*1000, col*4/num_lights parallel point_at 0 } #local i=i+1; #end #end /* sky_sphere { pigment { dome } } */ sphere { //so I can do no_radiosity 0, 1 pigment { dome } finish { ambient 1 diffuse 0 } scale 2000 inverse no_shadow #if (lights) //lighting from dome is being faked by lights no_radiosity #end } #default { pigment { rgb .8 } finish { diffuse 1 ambient 0 } } camera { right x up y*image_height/image_width direction z*.9 location <2,1,3>*1.5 look_at 0 } sphere { 0, 1 texture { pigment { rgb <0,.2,.03> } finish { brilliance 4 } } texture { pigment { rgb <0,.2,.03> transmit 1 } normal { facets coords 1 scale .05 } //finish { phong 2 phong_size 20 } //blurrier finish { reflection { .3 metallic 1 } } //cleaner } texture { pigment { rgbt 1 } finish { reflection { 0, 1 fresnel } conserve_energy } } interior { ior 1.3 } //finish { brilliance 100 diffuse 20 } //debug light placement } cylinder { -y, -y*5, 2 pigment { rgb <.3,.18,.1> } normal { granite -.1 scale .2 } }