// File: CreviceExample.pov // Desc: sample scene for Crevice.inc macro // Date: March 2011 // Auth: Trevor G Quayle #version 3.7; global_settings { charset utf8 assumed_gamma 1.0 ambient_light 1 adc_bailout 0.00001 max_trace_level 25 } #declare LA=<0,100,0>; #declare LO=<00,300,300>; camera{ up y right -x*image_width/image_height angle 60 location LO look_at LA } #default{finish{ambient 0 diffuse 0.5}} light_source { <5000,5000,3000> rgb 1 } plane{y,0 pigment{checker rgb 1 rgb 0 scale 15}} background{rgb 0.3} //Base object declared and transformed prior to sending to macro, does not need to be textured #declare MyObj= difference{ merge{//merged to avoid interference with interior surfaces for edge detection sphere{y*100,100} cylinder{y*80, y*120, 105} #for(i,0,330,30) sphere{0,5 translate <0,100,104> rotate y*i} #end } #for(i,15,345,30) sphere{0,8 translate <0,100,112> rotate y*i} #end } #declare Text_Base= texture{ pigment{rgb <0.3451, 0.17647, 0.04706>} finish{ ambient 0 diffuse 0.5 } } #declare Text_Paint= texture{ pigment{rgb 1} finish{ ambient 0 diffuse 0.5 conserve_energy reflection {0 1 metallic 1 fresnel on} } } #declare Text_Grime= texture{ pigment{rgb 0} finish{ ambient 0 diffuse 0.6 } } #include "arrays.inc" //must be included, must be newer one with ARRAYS_WriteDF3() #include "Crevice.inc" //Crevice.inc values to be used as common #declare CLoc=LO; //Camera location #declare Resn=500; //sample grid resolution. Warning: exponentially increases parse time! #declare RLmin=2; //minimal subsample adapt = 2^2 = 4 #declare RLmax=5; //maximum subsample adapt = 2^5 = 32 #declare CCnf=0.95; //subsample adapt confidence = 95% //Edge detection #declare CAng=-20; //control angle, negative for edges #declare CDep=10; //control depth #declare SOff=-0.01;//surface offset, negative for edges #declare Text1= texture{ Crevice(MyObj,CLoc,Resn,CAng,CDep,SOff,RLmin,RLmax,CCnf) poly_wave 0.5 texture_map{ [0.5 Text_Base] [1.0 Text_Paint] } } //Crevice detection #declare CAng=15; //control angle, positive for crevices #declare CDep=10; //control depth #declare SOff=0.01; //surface offset, positive for crevices #declare Text2= texture{ Crevice(MyObj,CLoc,Resn,CAng,CDep,SOff,RLmin,RLmax,CCnf) texture_map{ [0.1 Text_Grime] // [1.0 Text_Paint] [1.0 Text1] } } object{//object placed and material applied MyObj material{ texture{Text2} interior{ior 1.4} } }