//------------------------------------------------------------------------------ // dielectric.pov // 02/07/2011 // Robert W. McGregor, Rob@McGregorFineArt.com //------------------------------------------------------------------------------ // Animation settings: // initial_frame = 0 // final_frame = 2000 // initial_clock = 0 // final_clock = 1 // // Render settings: +w800 +h480 +a0.5 +am2 +r5 //------------------------------------------------------------------------------ #version 3.7; #include "transforms.inc" default { pigment { rgb 0.5 } finish { ambient 0 emission 0 specular 0 reflection 0 diffuse 0.8 } } //------------------------------------------------------------------------------ // Scene/Render Configuration //------------------------------------------------------------------------------ #declare Render_EnvironMap = 1; #declare Cam_Loc = <1, 0.5, -5>*1.3; #declare Cam_At = <0.3, 0, 0>; global_settings { assumed_gamma 1 photons { spacing 0.005 } radiosity { brightness 0.1 recursion_limit 2 pretrace_start 32/image_width pretrace_end 8/image_width count 128 error_bound 0.5 nearest_count 15 normal off always_sample off } } //------------------------------------------------------------------------------ // Camera & Lights //------------------------------------------------------------------------------ camera { //orthographic location Cam_Loc look_at Cam_At right x*image_width/image_height sky y-x*0.025 angle 40 } light_source { <-10, 10, -10> rgb <255,210,165>/255*1.25 area_light <2, 0, 0>, <0, 0, 2>, 5, 5 orient circular } //------------------------------------------------------------------------------ // Background //------------------------------------------------------------------------------ background {rgb 0.5} #if (Render_EnvironMap) sphere { 0, 10000 hollow inverse // HDR of the Uffizi Gallery from http://ict.debevec.org/~debevec/Probes/ // converted from to EXR and remapped to spherical (map_type 1) with // Ive's program IC using: 3D Projection-->Angular to Latitude/Longitude pigment { image_map { exr "uffizi_probe" interpolate 2 map_type 1 } } finish { emission 1 diffuse 0 } rotate y*195 } #end //------------------------------------------------------------------------------ // Dielectric Ball //------------------------------------------------------------------------------ // a curve that controls the IOR values in a non-linear fashion, from clock 0-1 #declare IOR_Spline = spline { quadratic_spline -0.25, <1,0> 0.00, <1,0> 0.50, <5.83, 0> 0.60, <10, 0> 0.70, <30, 0> 0.80, <80, 0> 0.95, <8000, 0> 1.00, <80000,0> 1.25, <80000,0> } #declare IOR = IOR_Spline(clock).x; #declare REFL = pow(((1-IOR)/(1+IOR)), 2); #declare TRANS = 1 - REFL; // Dielectric Ball sphere { 0, 1 texture { pigment { rgbt 1 } finish { reflection { 0, 1 fresnel on } conserve_energy } } interior { ior IOR } photons { target refraction on reflection on collect off } } //------------------------------------------------------------------------------ // stone "table" //------------------------------------------------------------------------------ box { -1, 1 translate -y*2 scale <3.5, 1, 3.5> texture { // a couple of tiling image maps for pigment and bump of the "table" pigment { image_map { png "ConcreteWall3_tile" map_type 0 } turbulence 0.01} normal { bump_map { png "ConcreteWall3_tile_bump" map_type 0 } turbulence 0.01 bump_size 1 } finish { specular 0.25 roughness 0.25 reflection { 0, 0.85 fresnel } conserve_energy } rotate x*90 rotate -y*90 scale 5 } } //------------------------------------------------------------------------------ // Play by play of the transparency/reflection values as IOR changes //------------------------------------------------------------------------------ #local PosY = 1.5; #local Col2X = -0.8; #local Font = "arial"; #local Scale = <0.12, 0.12, 0.035>; union { text { ttf Font "POV-Ray Dielectric Material Test", 1, 0 scale <0.12, 0.12, 0.05> translate <-1.55, PosY, 0> } text { ttf Font "ior", 1, 0 scale Scale translate <-1.55, PosY-0.15*1, 0> } text { ttf Font concat(": ", str(IOR,0,4)), 1, 0 scale Scale translate } text { ttf Font "transparency", 1, 0 scale Scale translate <-1.55, PosY-0.15*2, 0> } text { ttf Font concat(": ", str(TRANS,0,4)), 1, 0 scale Scale translate } text { ttf Font "reflection", 1, 0 scale Scale translate <-1.55, PosY-0.15*3, 0> } text { ttf Font concat(": ", str(REFL,0,4)), 1, 0 scale Scale translate } pigment { rgb 1.4 } Reorient_Trans(-z, Cam_Loc-Cam_At) translate <-0.5, -0.075, 0> rotate z*2.25 }