|
|
Scott,
Not sure how much it helps, but here's the method I use:
#declare PFunc = function{pigment{bozo}}
#macro RGBFunc(Channel)
PFunc(x, y, z)
#switch(Channel)#case(0).x#break #case(1).y#break #case(2).z#break #end
#end
sphere{
0, 1
pigment{
average
pigment_map{
[1 function{RGBFunc(0)} color_map{[0 rgb 0][1 rgb x*3]}]
[1 function{RGBFunc(1)} color_map{[0 rgb 0][1 rgb y*3]}]
[1 function{RGBFunc(2)} color_map{[0 rgb 0][1 rgb z*3]}]
}
}
}
That's just the bare-bones setup; there's still a lot of room for adjustment.
scott <sco### [at] scottcom> wrote:
> I had thought of doing such a thing but I don't know in my code how
> large the return values of the function will be (certainly not limited
> to 1). If there is no better alternative then I'll end up with something
> like this:
>
> #local K = 1e8;
> #local P_R=pigment{
> function{ functionR(x,y,z)/K }
> color_map{ [0,rgb <0,0,0>] [1,rgb <3*K,0,0>] }
> };
>
> But obviously I have to choose K large enough for all possible return
> values (maybe I can determine the upper limit with some maths).
I've had to do it that way, too. In my case I wanted to cover the entire color
range of an hdr image... but I think I just used 256 in the end. Might account
for some color banding I've seen since then ;)
Sam
Post a reply to this message
|
|