#version unofficial megapov 1.21; /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ edgeFinder.pov for MegaPOV 1.21 2010 Samuel Benge (moc.liamtoh@egnebts) It uses a simple edge-finding function. It looks for abrupt changes in color intensity and draws lines in those places. It's best to use a slope pattern for your objects to help define surfaces. render with +a0.3 +am2 +r3 @ 640x480 or better ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ /* ****************************************************************************** */ // user settings #default{finish{ambient 1}} // edge_radius (fraction of the actual image size) // change for different resolutions #declare edge_radius = .005; // true will render edges // false will display the actual scene #declare render_edges = true; // this pigment will be used for the effect #declare image = pigment{ // all of your usual camera settings should go here camera_view{ location<0,3,-10> look_at 0 angle 25 } // centers the image translate-(x+y)/2 // reduces unwanted artifacts at the image margin scale 1+edge_radius*2 } // some object text{ ttf"povlogo.ttf" "p" .3, 0 /* adding some color variation helps define edges which normally wouldn't render */ // scale the bumps pigment up if artifacts appear in your objects pigment{ bumps scale .5 pigment_map{ [0 slope<.3,.5,1> color_map{[0 rgb .5][1 rgb .75]}] [1 slope<.3,.5,1> color_map{[0 rgb .75][1 rgb 1]}] } } // uncomment this to see what happens... look closely // pigment{slope<.3,.5,1>} translate<-.3,-.56,0> scale 3 } /* uncomment this plane to see what happens to regular pigments */ // plane{y,-5 pigment{granite scale 125}} /* change this to ensure your object's color differs from the background color */ // there needs to be a contrast background{ rgb 1 } // end user settings /* ****************************************************************************** */ // preparing for the effect #declare image_function=function{pigment{image}} #declare image_function_ring= function{ pigment{ average pigment_map{ /* I have found that six samples are adequate */ #declare V=0; #while( V < 6) [1 image translate edge_radius*< sin(pi*2/6*V), cos(pi*2/6*V), 0> ] #declare V = V + 1; #end } } } /* the effect is applied to a box far removed from the scene's center */ box{<-1, -1, -1000>, <1, 1, -1000> pigment{ // some control variables #declare v1 = 1; // threshold #declare v2 = 1.005; // image weight #if( render_edges = true ) // the edge-finding routine is really simple function{ v1 +image_function_ring(x,y,z).gray -image_function(x,y,z).gray*v2 } color_map{[.5 rgb 0][.5 rgb 1]} #else pigment_pattern{image} #end } no_shadow hollow } // the real camera camera{ orthographic location -z*1001 look_at 0 right x up y }