// Persistence of Vision Ray Tracer Scene Description File // File: crackled-egg.pov // Vers: 3.5 // Desc: Crackled egg using ambient and regular lights // Date: 06/2003 // Auth: Nicolas Rougier // Cmd : povray +Icrackled-egg.pov +h600 +w600 +a0.1 +am2 +fn // --------------------------------------------------------------------------- #version 3.5; // ======================================== // Notes // ======================================== // // Experiment on using high ambient objects to illuminate a scene. // Here, the only "regular" light source is inside the crackled egg // // ======================================== // Settings // ======================================== global_settings { assumed_gamma 1.0 radiosity { pretrace_start 0.08 pretrace_end 0.02 count 600 error_bound 0.1 recursion_limit 1 gray_threshold 0 brightness 2.0 // <= !!! normal on } } // ======================================== // Camera // ======================================== #declare EyePos = <0.0, 10.0, -25.0>; #declare EyeLook = <0.0, 5.0, 0.0>; camera { location EyePos direction 1.5*z right x*image_width/image_height look_at EyeLook angle 40 } // ======================================== // Default settings // ======================================== #default { texture { finish { ambient 0.0 diffuse 0.65 } } } // ======================================== // Regular light inside the egg // ======================================== light_source { <0,8,-1.0> color rgb <2, .5, 0> fade_power 2 fade_distance 4 rotate -y*10 } // ======================================== // Ambient light // ======================================== // The macro alight create a set of n (=10) concentric discs with // fading ambient value. // Color goes from <0.8,0.8,1> to <1,1,1> (should be a parameter) // // _size : size of larget disc // _intensity: larget ambient value (disc in the center) // _falloff : Exponential fallof of ambient value // #macro alight (_size, _intensity, _falloff) #local n = 10; #local i = 1; union { #while (i, i/n, (i-1)/n scale _size pigment {rgb <0.8+.3*i/n , 0.8+.3*i/n, 1> } finish {ambient _intensity * (1 - pow (i/n,_falloff))} } #local i = i+1; #end hollow no_shadow } #end // Here is the light // You have to find the balance between light distance, size // and intensity (and falloff indeed). From my own experience, // putting a small light near the object makes it appear quit // flat and produces a lot of radiosity artifacts. object { alight (2500, 3, .5) // Light distance is 1000 pov units translate y*1000 // Classical light coming from left at 55° vertical angle rotate -x*55 rotate y*45 } // ======================================== // Ground and back wall // ======================================== union { plane {y, 0} box {<-1000, -1, 100>, <1000, 100, 101>} texture{ pigment {rgb 1} finish {ambient .1 diffuse 0.65} } } // ======================================== // Egg object // ======================================== // Crackle pigment #declare p_crackle = pigment { crackle pigment_map { [0.000 rgbt 1] [0.039 rgbt 1] [0.040 rgbt <0.92, 0.78, 0.62, 0>] } scale .15 } // Plain pigment #declare p_plain = pigment { rgbt <0.92, 0.78, 0.62, 0> } // Egg texture #declare t_egg = texture { pigment { spherical pigment_map { [0.30 p_plain] [0.40 p_crackle] } translate 2*y-.5*z rotate -y*30 } finish { diffuse .85 specular .4 roughness .005 } } #declare Egg = union { intersection { sphere {0,1 scale<1,1.5,1>} box {<-1,0,-1>,<1,1.5,1>} } intersection { sphere {0,1} box {<-1,-1,-1>,<1,0,1>} } translate y*1 texture {t_egg} //! -0.1 is necessary normal {granite -0.1 scale 0.15 cubic_wave} //! Reduce size to 1 unit scale 1/2.5 } object { Egg scale 10 hollow }