![](/i/fill.gif) |
![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Michael Andrews <m.c### [at] reading ac uk> wrote:
> #declare REBUILD = pigment { ... }
> how do you define REBUILD to give the same pigment as PIG, based on
> FNPIG?
AFAIK, it's not currently possible.
--
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}// - Warp -
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Warp wrote:
>
> Michael Andrews <m.c### [at] reading ac uk> wrote:
> > #declare REBUILD = pigment { ... }
>
> > how do you define REBUILD to give the same pigment as PIG, based on
> > FNPIG?
>
> AFAIK, it's not currently possible.
>
Well, yes it is possible (see the picture I just posted in Gilles' fast
cloud thread on p.b.i) but the method I've found is pretty brute-force
and klutzy. I was hoping somone would have a bright idea on how to do it
better than I have. That's why I haven't posted my attempt yet - I don't
want to predispose folks to look at the problem from one direction.
If noone comes up with anything by the weekend I'll post my solution.
Bye for now,
Mike Andrews.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On Thu, 11 Apr 2002 13:18:26 +0100, Michael Andrews <m.c### [at] reading ac uk>
wrote:
> If noone comes up with anything by the weekend I'll post my solution.
layers ?
ABX
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
--
__________________
RAY
"Michael Andrews" <m.c### [at] reading ac uk> wrote in message
news:3CB### [at] reading ac uk...
> Hi Folks,
>
> I was playing with Gilles' cloud pigment and hit a problem: what is the
> best (ie fastest rendering) way to reproduce an arbitrary pigment from
> it's function?
>
> For example, given
>
> #declare PIG = pigment { bozo colour_map {[0.2 rgbf 1][0.5 rgb
> y*1.3][0.7 rgb x transmit 1] } }
> #declare FNPIG = function { pigment { PIG } }
>
> #declare REBUILD = pigment { ... }
>
> how do you define REBUILD to give the same pigment as PIG, based on
> FNPIG?
>
> Normally it's just a matter of
>
> #declare REBUILD = pigment {
> average
> pigment_map {
> [1 function { FNPIG(x,y,z).x } colour_map {[0 rgb 0][1 rgb 3*x]} ]
> [1 function { FNPIG(x,y,z).y } colour_map {[0 rgb 0][1 rgb 3*y]} ]
> [1 function { FNPIG(x,y,z).z } colour_map {[0 rgb 0][1 rgb 3*z]} ]
> }
> }
would #declare REBUILD = pigment {function {FNPIG}}; work
> but with filter, transmit or colours with values greater than one this
> doesn't work.
>
> I've come up with one structure which works, but is very slow for how I
> am using it.
>
> So, I was hoping someone can come up with a better method. Any takers?
Yes ;-)
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
#declare REBUILD = pigment {
average
pigment_map {
[1 function{FNPIG(x,y,z).red} colour_map {[0 rgbft<-2, 0, 0, 0,
0>][1 rgbft< 3, 0, 0, 0, 0>]}]
[1 function{FNPIG(x,y,z).green} colour_map {[0 rgbft< 0,-2, 0, 0,
0>][1 rgbft< 0, 3, 0, 0, 0>]}]
[1 function{FNPIG(x,y,z).blue} colour_map {[0 rgbft< 0, 0,-2, 0,
0>][1 rgbft< 0, 0, 3, 0, 0>]}]
[1 function{FNPIG(x,y,z).filter} colour_map {[0 rgbft< 1, 1, 1, 0,
0>][1 rgbft< 1, 1, 1, 5, 0>]}]
[1 function{FNPIG(x,y,z).transmit}colour_map {[0 rgbft< 1, 1, 1, 0,
0>][1 rgbft< 1, 1, 1, 0, 5>]}]
}
}
This seems to work. I'm fairly certain the math is OK, but I still have
to mull it over. Seemed to worked in a visual comparison test with the
original and rebuilt pigments side by side.
Michael Andrews wrote:
>
> Warp wrote:
> >
> > Michael Andrews <m.c### [at] reading ac uk> wrote:
> > > #declare REBUILD = pigment { ... }
> >
> > > how do you define REBUILD to give the same pigment as PIG, based on
> > > FNPIG?
> >
> > AFAIK, it's not currently possible.
> >
> Well, yes it is possible (see the picture I just posted in Gilles' fast
> cloud thread on p.b.i) but the method I've found is pretty brute-force
> and klutzy. I was hoping somone would have a bright idea on how to do it
> better than I have. That's why I haven't posted my attempt yet - I don't
> want to predispose folks to look at the problem from one direction.
>
> If noone comes up with anything by the weekend I'll post my solution.
>
> Bye for now,
> Mike Andrews.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
...except it still will not work for color component values outside of
the range of 0 to 1 since the technique is limited by the color_map
index range. A workaround (if one knew beforehand the color range) would
involve scaling FNPIG by 1/[maximum expected color range] and setting up
the color_map entries to cover the maximum expected color range.
Abe
Abe wrote:
>
> #declare REBUILD = pigment {
> average
> pigment_map {
> [1 function{FNPIG(x,y,z).red} colour_map {[0 rgbft<-2, 0, 0, 0,
> 0>][1 rgbft< 3, 0, 0, 0, 0>]}]
> [1 function{FNPIG(x,y,z).green} colour_map {[0 rgbft< 0,-2, 0, 0,
> 0>][1 rgbft< 0, 3, 0, 0, 0>]}]
> [1 function{FNPIG(x,y,z).blue} colour_map {[0 rgbft< 0, 0,-2, 0,
> 0>][1 rgbft< 0, 0, 3, 0, 0>]}]
> [1 function{FNPIG(x,y,z).filter} colour_map {[0 rgbft< 1, 1, 1, 0,
> 0>][1 rgbft< 1, 1, 1, 5, 0>]}]
> [1 function{FNPIG(x,y,z).transmit}colour_map {[0 rgbft< 1, 1, 1, 0,
> 0>][1 rgbft< 1, 1, 1, 0, 5>]}]
> }
> }
>
> This seems to work. I'm fairly certain the math is OK, but I still have
> to mull it over. Seemed to worked in a visual comparison test with the
> original and rebuilt pigments side by side.
>
> Michael Andrews wrote:
> >
> > Warp wrote:
> > >
> > > Michael Andrews <m.c### [at] reading ac uk> wrote:
> > > > #declare REBUILD = pigment { ... }
> > >
> > > > how do you define REBUILD to give the same pigment as PIG, based on
> > > > FNPIG?
> > >
> > > AFAIK, it's not currently possible.
> > >
> > Well, yes it is possible (see the picture I just posted in Gilles' fast
> > cloud thread on p.b.i) but the method I've found is pretty brute-force
> > and klutzy. I was hoping somone would have a bright idea on how to do it
> > better than I have. That's why I haven't posted my attempt yet - I don't
> > want to predispose folks to look at the problem from one direction.
> >
> > If noone comes up with anything by the weekend I'll post my solution.
> >
> > Bye for now,
> > Mike Andrews.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"RAY" <RAY### [at] yahoo com> wrote in message news:3cb73511@news.povray.org...
>
>
> --
> __________________
> RAY
> "Michael Andrews" <m.c### [at] reading ac uk> wrote in message
> news:3CB### [at] reading ac uk...
> > Hi Folks,
> >
> > I was playing with Gilles' cloud pigment and hit a problem: what is the
> > best (ie fastest rendering) way to reproduce an arbitrary pigment from
> > it's function?
> >
> > For example, given
> >
> > #declare PIG = pigment { bozo colour_map {[0.2 rgbf 1][0.5 rgb
> > y*1.3][0.7 rgb x transmit 1] } }
> > #declare FNPIG = function { pigment { PIG } }
Replace this with a five-parameter function:
#declare FNPIG = function(rd,gr,bl,ft,tr) { pigment { PIG } }
> >
> > #declare REBUILD = pigment { ... }
> >
> > how do you define REBUILD to give the same pigment as PIG, based on
> > FNPIG?
> >
> > Normally it's just a matter of
> >
> > #declare REBUILD = pigment {
> > average
> > pigment_map {
> > [1 function { FNPIG(x,y,z).x } colour_map {[0 rgb 0][1 rgb 3*x]} ]
> > [1 function { FNPIG(x,y,z).y } colour_map {[0 rgb 0][1 rgb 3*y]} ]
> > [1 function { FNPIG(x,y,z).z } colour_map {[0 rgb 0][1 rgb 3*z]} ]
> > }
> > }
>
> would #declare REBUILD = pigment {function {FNPIG}}; work
After replacing the FNPIG function, the simple declare should work:
#declare REBUILD = pigment { function(rd,gr,bl,ft,tr) {FNPIG}}
>
> > but with filter, transmit or colours with values greater than one this
> > doesn't work.
> >
> > I've come up with one structure which works, but is very slow for how I
> > am using it.
> >
> > So, I was hoping someone can come up with a better method. Any takers?
> Yes ;-)
>
>
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
David Wallace <dar### [at] earthlink net> wrote:
> #declare REBUILD = pigment { function(rd,gr,bl,ft,tr) {FNPIG}}
Have you actually tried that?
--
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
From: David Wallace
Subject: Re: Reproducing pigment from functions ...
Date: 12 Apr 2002 22:29:14
Message: <3cb797fa@news.povray.org>
|
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"Michael Andrews" <m.c### [at] reading ac uk> wrote in message
news:3CB45A4F.413CA07F@reading.ac.uk...
>
>
> > [1 function { FNPIG(x,y,z).filter } colour_map {[0 rgb 0][1 filter
5]} ]
>
> Sorry, no, this is always black :-/
>
> I hadn't thought of trying this way though ...
>
> Bye for now,
> Mike Andrews.
I tried a 5-parameter function thinking that the results would be truncated
otherwise... POV rejected it as an error:
"Function parameters for pigment functions are not allowed."
I suspect that your problem is that any 5D color vector that is interpreted
in a function block is truncated to 3D RGB form. If that's so then you're
SOL.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
From: Thorsten Froehlich
Subject: Re: Reproducing pigment from functions ...
Date: 13 Apr 2002 16:45:08
Message: <3cb898d4@news.povray.org>
|
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
In article <3cb797fa@news.povray.org> , "David Wallace"
<dar### [at] earthlink net> wrote:
> I tried a 5-parameter function thinking that the results would be truncated
> otherwise... POV rejected it as an error:
> "Function parameters for pigment functions are not allowed."
>
> I suspect that your problem is that any 5D color vector that is interpreted
> in a function block is truncated to 3D RGB form. If that's so then you're
> SOL.
No, this is not the case. The error message simply says you may not specify
function parameters for functions with a fixed parameter list, which is
explained in the documentation.
Thorsten
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |