global_settings { max_trace_level 50 assumed_gamma 1 ambient_light 1 } background { color rgb <0.2,0.3,0.9>*0.2 } #declare lightDir = vrotate(vnormalize(<-0.1,0.3,-1>), 0); #declare lightLen = 100000; #declare lightRad = lightLen*2*sin(radians(0.25)); #declare camPos = <1.0, 1.0, -20>*7; #declare camLookAt = <0.0,0.0,0.0>; #declare camAngle = 50; camera { up y right x*image_width/image_height location camPos direction z angle camAngle look_at camLookAt } light_source { 0*x colour rgb <1.0,.98,.96> translate lightDir*lightLen parallel point_at camLookAt } #declare PIG = pigment { bozo colour_map {[0.1 rgbf 1][0.3 rgb y filter 1][0.5 rgb y*1.3][0.7 rgb x][0.9 rgb x transmit 1] } } #declare FNPIG = function { pigment { PIG } } #declare FNPIG_R = function { FNPIG(x,y,z).red } #declare FNPIG_G = function { FNPIG(x,y,z).green } #declare FNPIG_B = function { FNPIG(x,y,z).blue } #declare FNPIG_F = function { FNPIG(x,y,z).filter } #declare FNPIG_T = function { FNPIG(x,y,z).transmit } #declare REBUILD1 = pigment { function { FNPIG_T(x,y,z) } pigment_map { [0 function { FNPIG_F(x,y,z) } pigment_map { [0 average pigment_map { [1 function { tanh(FNPIG_R(x,y,z)) } colour_map {[0 rgb 0][tanh(0.25) rgb 0.25*3*x][tanh(0.5) rgb 0.5*3*x][tanh(0.75) rgb 0.75*3*x][tanh(1) rgb 3*x][tanh(1.25) rgb 1.25*3*x][tanh(1.5) rgb 1.5*3*x][tanh(1.75) rgb 1.75*3*x][tanh(2) rgb 2*3*x]} ] [1 function { tanh(FNPIG_G(x,y,z)) } colour_map {[0 rgb 0][tanh(0.25) rgb 0.25*3*y][tanh(0.5) rgb 0.5*3*y][tanh(0.75) rgb 0.75*3*y][tanh(1) rgb 3*y][tanh(1.25) rgb 1.25*3*y][tanh(1.5) rgb 1.5*3*y][tanh(1.75) rgb 1.75*3*y][tanh(2) rgb 2*3*y]} ] [1 function { tanh(FNPIG_B(x,y,z)) } colour_map {[0 rgb 0][tanh(0.25) rgb 0.25*3*z][tanh(0.5) rgb 0.5*3*z][tanh(0.75) rgb 0.75*3*z][tanh(1) rgb 3*z][tanh(1.25) rgb 1.25*3*z][tanh(1.5) rgb 1.5*3*z][tanh(1.75) rgb 1.75*3*z][tanh(2) rgb 2*3*z]} ] } ] [1 average pigment_map { [1 function { tanh(FNPIG_R(x,y,z)) } colour_map {[0 filter 1][tanh(0.25) rgb 0.25*3*x filter 1][tanh(0.5) rgb 0.5*3*x filter 1][tanh(0.75) rgb 0.75*3*x filter 1][tanh(1) rgb 3*x filter 1][tanh(1.25) rgb 1.25*3*x filter 1][tanh(1.5) rgb 1.5*3*x filter 1][tanh(1.75) rgb 1.75*3*x filter 1][tanh(2) rgb 2*3*x filter 1]} ] [1 function { tanh(FNPIG_G(x,y,z)) } colour_map {[0 filter 1][tanh(0.25) rgb 0.25*3*y filter 1][tanh(0.5) rgb 0.5*3*y filter 1][tanh(0.75) rgb 0.75*3*y filter 1][tanh(1) rgb 3*y filter 1][tanh(1.25) rgb 1.25*3*y filter 1][tanh(1.5) rgb 1.5*3*y filter 1][tanh(1.75) rgb 1.75*3*y filter 1][tanh(2) rgb 2*3*y filter 1]} ] [1 function { tanh(FNPIG_B(x,y,z)) } colour_map {[0 filter 1][tanh(0.25) rgb 0.25*3*z filter 1][tanh(0.5) rgb 0.5*3*z filter 1][tanh(0.75) rgb 0.75*3*z filter 1][tanh(1) rgb 3*z filter 1][tanh(1.25) rgb 1.25*3*z filter 1][tanh(1.5) rgb 1.5*3*z filter 1][tanh(1.75) rgb 1.75*3*z filter 1][tanh(2) rgb 2*3*z filter 1]} ] } ] } ] [1 function { FNPIG_F(x,y,z) } pigment_map { [0 average pigment_map { [1 function { tanh(FNPIG_R(x,y,z)) } colour_map {[0 transmit 1][tanh(0.25) rgb 0.25*3*x transmit 1][tanh(0.5) rgb 0.5*3*x transmit 1][tanh(0.75) rgb 0.75*3*x transmit 1][tanh(1) rgb 3*x transmit 1][tanh(1.25) rgb 1.25*3*x transmit 1][tanh(1.5) rgb 1.5*3*x transmit 1][tanh(1.75) rgb 1.75*3*x transmit 1][tanh(2) rgb 2*3*x transmit 1]} ] [1 function { tanh(FNPIG_G(x,y,z)) } colour_map {[0 transmit 1][tanh(0.25) rgb 0.25*3*y transmit 1][tanh(0.5) rgb 0.5*3*y transmit 1][tanh(0.75) rgb 0.75*3*y transmit 1][tanh(1) rgb 3*y transmit 1][tanh(1.25) rgb 1.25*3*y transmit 1][tanh(1.5) rgb 1.5*3*y transmit 1][tanh(1.75) rgb 1.75*3*y transmit 1][tanh(2) rgb 2*3*y transmit 1]} ] [1 function { tanh(FNPIG_B(x,y,z)) } colour_map {[0 transmit 1][tanh(0.25) rgb 0.25*3*z transmit 1][tanh(0.5) rgb 0.5*3*z transmit 1][tanh(0.75) rgb 0.75*3*z transmit 1][tanh(1) rgb 3*z transmit 1][tanh(1.25) rgb 1.25*3*z transmit 1][tanh(1.5) rgb 1.5*3*z transmit 1][tanh(1.75) rgb 1.75*3*z transmit 1][tanh(2) rgb 2*3*z transmit 1]} ] } ] [1 average pigment_map { [1 function { tanh(FNPIG_R(x,y,z)) } colour_map {[0 filter 1 transmit 1][tanh(0.25) rgb 0.25*3*x filter 1 transmit 1][tanh(0.5) rgb 0.5*3*x filter 1 transmit 1][tanh(0.75) rgb 0.75*3*x filter 1 transmit 1][tanh(1) rgb 3*x filter 1 transmit 1][tanh(1.25) rgb 1.25*3*x filter 1 transmit 1][tanh(1.5) rgb 1.5*3*x filter 1 transmit 1][tanh(1.75) rgb 1.75*3*x filter 1 transmit 1][tanh(2) rgb 2*3*x filter 1 transmit 1]} ] [1 function { tanh(FNPIG_G(x,y,z)) } colour_map {[0 filter 1 transmit 1][tanh(0.25) rgb 0.25*3*y filter 1 transmit 1][tanh(0.5) rgb 0.5*3*y filter 1 transmit 1][tanh(0.75) rgb 0.75*3*y filter 1 transmit 1][tanh(1) rgb 3*y filter 1 transmit 1][tanh(1.25) rgb 1.25*3*y filter 1 transmit 1][tanh(1.5) rgb 1.5*3*y filter 1 transmit 1][tanh(1.75) rgb 1.75*3*y filter 1 transmit 1][tanh(2) rgb 2*3*y filter 1 transmit 1]} ] [1 function { tanh(FNPIG_B(x,y,z)) } colour_map {[0 filter 1 transmit 1][tanh(0.25) rgb 0.25*3*z filter 1 transmit 1][tanh(0.5) rgb 0.5*3*z filter 1 transmit 1][tanh(0.75) rgb 0.75*3*z filter 1 transmit 1][tanh(1) rgb 3*z filter 1 transmit 1][tanh(1.25) rgb 1.25*3*z filter 1 transmit 1][tanh(1.5) rgb 1.5*3*z filter 1 transmit 1][tanh(1.75) rgb 1.75*3*z filter 1 transmit 1][tanh(2) rgb 2*3*z filter 1 transmit 1]} ] } ] } ] } } #declare maxCol = <1,1,1,1,1>*1.5; #declare mR = (maxCol.red); #declare mG = (maxCol.green); #declare mB = (maxCol.blue); #declare mF = (maxCol.filter); #declare mT = (maxCol.transmit); #declare REBUILD2 = pigment { function { FNPIG_T(x,y,z)/mT } pigment_map { [0 function { FNPIG_F(x,y,z)/mF } pigment_map { [0 average pigment_map { [1 function { FNPIG_R(x,y,z)/mR } colour_map {[0 rgb 0][1 rgb 3*x*mR]} ] [1 function { FNPIG_G(x,y,z)/mG } colour_map {[0 rgb 0][1 rgb 3*y*mG]} ] [1 function { FNPIG_B(x,y,z)/mB } colour_map {[0 rgb 0][1 rgb 3*z*mB]} ] } ] [1 average pigment_map { [1 function { FNPIG_R(x,y,z)/mR } colour_map {[0 filter mF][1 rgb 3*x*mR filter mF]} ] [1 function { FNPIG_G(x,y,z)/mG } colour_map {[0 filter mF][1 rgb 3*y*mG filter mF]} ] [1 function { FNPIG_B(x,y,z)/mB } colour_map {[0 filter mF][1 rgb 3*z*mB filter mF]} ] } ] } ] [1 function { FNPIG_F(x,y,z)/mF } pigment_map { [0 average pigment_map { [1 function { FNPIG_R(x,y,z)/mR } colour_map {[0 transmit mT][1 rgb 3*x*mR transmit mT]} ] [1 function { FNPIG_G(x,y,z)/mG } colour_map {[0 transmit mT][1 rgb 3*y*mG transmit mT]} ] [1 function { FNPIG_B(x,y,z)/mB } colour_map {[0 transmit mT][1 rgb 3*z*mB transmit mT]} ] } ] [1 average pigment_map { [1 function { FNPIG_R(x,y,z)/mR } colour_map {[0 filter mF transmit mT][1 rgb 3*x*mR filter mF transmit mT]} ] [1 function { FNPIG_G(x,y,z)/mG } colour_map {[0 filter mF transmit mT][1 rgb 3*y*mG filter mF transmit mT]} ] [1 function { FNPIG_B(x,y,z)/mB } colour_map {[0 filter mF transmit mT][1 rgb 3*z*mB filter mF transmit mT]} ] } ] } ] } } #undef FNPIG box { -<20,20,0.1>,<20,20,0.1> pigment { REBUILD2 scale 5 } rotate 0 translate <-25,-25,0> } box { -<20,20,0.1>,<20,20,0.1> pigment { REBUILD1 scale 5 } rotate 0 translate <-25,25,0> } box { -<20,20,0.1>,<20,20,0.1> pigment { PIG scale 5 } rotate 0 translate <25,25,0> } //plane { -z, 19.9 pigment { rgb 0 } finish { ambient 1 diffuse 0 } } //plane { -z, 19.9 pigment { rgb 1 } finish { ambient 1 diffuse 0 } } plane { -z, 0 pigment { checker rgb 1, rgb 0 scale 5 } finish { ambient 1 diffuse 0 } }