|
![](/i/fill.gif) |
Skip Talbot <ski### [at] aol com> wrote:
> I don't have time to write out the source, but I can suggest a possible
> solution if you are looking for a quick answer. Use your image map as a
> pigment function, and then you should be able to directly multiply the
> output of the function by whatever scalar you want. The function and
> its multiplied scalar can then be declared as a new pigment function.
> Hopefully one of the pros can help get you setup with this approach if
> you have any trouble.
>
> Skip
Hopefully this can help:
//declare image map as a function
#declare PIMAGE = function {pigment{image_map {jpeg "body_01.jpg"
interpolate 2}}
#declare Mult=rgb <1,1,1>; //multiplier colour
//r,g,b components need to be calculated individually as functions can't
carry vectors:
#declare FRed=function(x,y,z) {PIMAGE(x,y,z).red *Mult.red}
#declare FGrn=function(x,y,z) {PIMAGE(x,y,z).green*Mult.green}
#declare FBlu=function(x,y,z) {PIMAGE(x,y,z).blue *Mult.blue}
//assemble using average: (colours multiplied by 3 so they average to 1)
#declare Pig=
pigment{average
pigment_map{
[function{FRed(x,y,z)*3} color_map{[0 rgb 0][1 rgb <1,0,0>]}]
[function{FGrn(x,y,z)*3} color_map{[0 rgb 0][1 rgb <0,1,0>]}]
[function{FBlu(x,y,z)*3} color_map{[0 rgb 0][1 rgb <0,0,1>]}]
}
}
-tgq
Post a reply to this message
|
![](/i/fill.gif) |