//crackle city scape //by tek #version 3.5; //scene controls #declare boOrthoCam = false;//true; //set this to false for a perspective view with a nice sunset. //includes #include "functions.inc" #include "rad_def.inc" //global set up global_settings { max_trace_level 5 radiosity { Rad_Settings(Radiosity_Fast, off, off) } } #default { finish { diffuse 1 ambient 0 } } //textures //objects #declare nMetric = 1; #declare fScale = 0.5; #declare fRoads = 0.3; #declare pCracks = pigment { crackle solid metric nMetric poly_wave 1.5 colour_map { [0 rgb 0] [1 rgb 1] } } #declare f_Cracks1 = function { pigment { pCracks scale fScale } } #declare f_Cracks2 = function { pigment { crackle metric nMetric pigment_map { [0.0 rgb 0] [1.0 rgb 1] } scale fScale } } #declare oCrackScape = isosurface { function { min ( max ( y - f_Cracks1(x,0,z).red*1.5, fRoads - f_Cracks2(x,0,z).red ), y ) } #if ( boOrthoCam ) max_gradient 4 #else max_gradient 8//30 accuracy 0.0001 #end contained_by { sphere { 0, 100 } } texture { pigment { rgb 1 } } } //the scene camera { #if ( boOrthoCam ) orthographic #end #declare fOrthoSize = 20; #declare image_dim = sqrt(image_width*image_height); //kind of average dimension right x*image_width/image_dim*fOrthoSize up y*image_height/image_dim*fOrthoSize direction z*fOrthoSize*0.5 #declare vCamPos = <0,0,-1.0>; #declare vCamPos = trace ( oCrackScape, vCamPos + y*100, -y ); #declare vCamPos = vCamPos + <0,0,0.01>; translate vCamPos #if ( boOrthoCam ) location <1,1,-1>*10 look_at 0 #end } #declare gvSunDir = vnormalize(<0,0.2,1>); sky_sphere { pigment { bozo scale 0.7 colour_map { [0 rgb <1,2,3>/10] [1 rgb 1+<3,2,1>/10] } } //sun pigment { gradient gvSunDir scale 2 translate -gvSunDir poly_wave 20 colour_map { [0 rgb <3,2,1>*1 transmit 1] [1 rgb <3,2,1>*1 transmit 0] } } } light_source { gvSunDir*10000 rgb <3,2,1>*0.5 //area_light x*100,y*100,8,8 circular orient } object { oCrackScape translate -0.5*y }