|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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]} ]
}
}
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?
Bye for now,
Mike Andrews.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On Wed, 10 Apr 2002 14:12:15 +0100, Michael Andrews <m.c### [at] readingacuk>
wrote:
>#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]} ]
> }
>}
>
>but with filter, transmit or colours with values greater than one this
>doesn't work.
have you teste below ? I'm not sure but I think it should work
#declare REBUILD = pigment {
average
pigment_map {
[1 function { FNPIG(x,y,z).red } colour_map {[0 rgb 0][1 red 5]} ]
[1 function { FNPIG(x,y,z).green } colour_map {[0 rgb 0][1 green 5]} ]
[1 function { FNPIG(x,y,z).blue } colour_map {[0 rgb 0][1 blue 5]} ]
[1 function { FNPIG(x,y,z).filter } colour_map {[0 rgb 0][1 filter 5]} ]
[1 function { FNPIG(x,y,z).transmit } colour_map {[0 rgb 0][1 transmit 5]} ]
}
}
ABX
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> [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.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Michael Andrews <m.c### [at] readingacuk> 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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Warp wrote:
>
> Michael Andrews <m.c### [at] readingacuk> 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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On Thu, 11 Apr 2002 13:18:26 +0100, Michael Andrews <m.c### [at] readingacuk>
wrote:
> If noone comes up with anything by the weekend I'll post my solution.
layers ?
ABX
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
--
__________________
RAY
"Michael Andrews" <m.c### [at] readingacuk> wrote in message
news:3CB### [at] readingacuk...
> 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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
#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] readingacuk> 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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
...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] readingacuk> 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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"RAY" <RAY### [at] yahoocom> wrote in message news:3cb73511@news.povray.org...
>
>
> --
> __________________
> RAY
> "Michael Andrews" <m.c### [at] readingacuk> wrote in message
> news:3CB### [at] readingacuk...
> > 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
|
|
| |
| |
|
|
|
|
| |
|
|