#macro powerMap(max_steps) #for (i, 0, max_steps) [i/max_steps rgb pow(i/max_steps,2)] #end #end #macro rootMap(max_steps) #for (i, 0, max_steps) [i/max_steps rgb sqrt(i/max_steps)] #end #end // low slopes are sorta best #declare pigment_1 = pigment { slope {+y} color_map { [0 rgb 0] [1 rgb 1] } } // low slopes are very best #declare pigment_2 = pigment { slope {+y} color_map { powerMap(1000) } } // low altitude is very best #declare pigment_3 = pigment { gradient +y color_map { powerMap(1000) } scale 1/10 } // high altitude is sorta best #declare pigment_4 = pigment { gradient +y color_map { rootMap(1000) } scale 1/10 } #declare pigment_5 = pigment { average pigment_map { [1.0 pigment_2] [1.0 pigment_3] } } #macro pigment_multiply(p1, p2) pigment { #local PR1 = function {pigment{p1}} #local PR2 = function {pigment{p2}} #local PR_FR=function (x,y,z) {PR1(x,y,z).red * PR2(x,y,z).red} #local PR_FG=function (x,y,z) {PR1(x,y,z).green * PR2(x,y,z).green} #local PR_FB=function (x,y,z) {PR1(x,y,z).blue * PR2(x,y,z).blue} #local PR_FF=function (x,y,z) {PR1(x,y,z).filter * PR2(x,y,z).filter} #local PR_FT=function (x,y,z) {PR1(x,y,z).transmit* PR2(x,y,z).transmit} average pigment_map { [function{PR_FR(x,y,z)} color_map{[0 rgb 0][1 rgbft 5*<1,0,0,0,0>]}] [function{PR_FG(x,y,z)} color_map{[0 rgb 0][1 rgbft 5*<0,1,0,0,0>]}] [function{PR_FB(x,y,z)} color_map{[0 rgb 0][1 rgbft 5*<0,0,1,0,0>]}] [function{PR_FF(x,y,z)} color_map{[0 rgb 0][1 rgbft 5*<0,0,0,1,0>]}] [function{PR_FT(x,y,z)} color_map{[0 rgb 0][1 rgbft 5*<0,0,0,0,1>]}] } } #end #declare pigment_6 = pigment_multiply(pigment_2, pigment_3) // low slopes are best height_field { png "heightmap.png" scale y/10 pigment {pigment_6} finish {ambient 0 diffuse 0 emission 1} } camera { orthographic location +y*100 direction -y right +x up +z translate <1/2,0,1/2> }