#version 3.6; #declare fp=function{pigment{image_map{png "test.png" interpolate 2}}} #declare RED = pigment { function { fp(x,y,z).red } color_map { [0 rgb 0][1 rgb <1,0,0>] } } #declare GREEN = pigment { function { fp(x,y,z).green } color_map { [0 rgb 0][1 rgb <0,1,0>] } } #declare BLUE = pigment { function { fp(x,y,z).blue } color_map { [0 rgb 0][1 rgb <0,0,1>] } } box{-.5,.5 texture{ pigment{ average pigment_map{ [1 RED] [1 GREEN] [1 BLUE] } } finish{ ambient 3 } } }