//Copy to comandline: // +fn16 +kff3 -a // //This does not work with anti aliasing if you want it //you'll have to render at a higher res and resize #declare Step=frame_number; //Render all three Steps in an anim #declare Cam_pos=<-8,10,-12>;// look at p_textures.inc #declare Cam_look_at=<0,0,0>;// to see for what these #declare Scene_scale=20; // variables are used #declare Radius_Dist=2; //Blur radius for depth information #declare Radius_Norm=2; //Blur radius for normal information #declare Di_Dist=0.01; // when the difference between the original image(from Step 2) #declare Di_Norm=0.015; // and the blurred one is bigger than this threshold than the pixel is black. // if you see some strange artifacts increase these values // if there somewhere should be lines but aren't decrease them #declare Dist=off; // use depth info to draw lines(not neccesary in this scene) #declare Norm=on; // --- normal ---- -- ---- ----- #include"math.inc" #include"p_objects.inc" #include"p_textures.inc" //Camera for Step 1 and 2 #if(Step=1|Step=2) camera{ location Cam_pos right x*image_width/image_height up y look_at Cam_look_at angle 60 } #end //Step 1 #if(Step=1) global_settings{ assumed_gamma 1 } light_source{<20,50,-10> rgb 1} object{Something texture{Something_tex} } object{Ground texture{Ground_tex} } #end //Step 2 #if(Step=2) object{Something texture{Info_tex} } object{Ground texture{Info_tex} } #end //Step 3 /* In Step 3 the lines are created from the image created in Step 2 and finaly the image from Step 1 and the lines are combined */ #if(Step=3) //we'll be looking at three planes with images on them //so we need an orthographic camera camera{ orthographic location -z right image_width*x up image_height*y look_at 0 } //create function containing image from Step 2 #declare Ifun= function{ pigment{ image_map{ png "p_main2" } warp{repeat x flip x}// this is to avoid black lines at the image borders warp{repeat y flip y}// Thanks to TinCanMan for this translate -.5 scale } } //Here the red(depth) and green and blue(normal) channels get blurred #declare Ifun_red_blur= function{ ( #local Z1=-Radius_Dist; #while(Z1 } finish{diffuse 0 ambient 1} } //lines caused by the normal #if(Norm) plane{z,1 pigment{ function{Ofun_Norm(x,y,z)} color_map{ [0 rgbt 1] [1 rgb 0] } } finish{ambient 1 diffuse 0} } #end //lines caused by the depth #if(Dist) plane{z,0 pigment{ function{Ofun_Distance(x,y,z)} color_map{ [0 rgbt 1] [1 rgb 0] } } finish{ambient 1 diffuse 0} } #end #end