POV-Ray : Newsgroups : povray.advanced-users : Reproducing pigment from functions ... : Re: Reproducing pigment from functions ... Server Time
29 Jul 2024 12:29:22 EDT (-0400)
  Re: Reproducing pigment from functions ...  
From: Abe
Date: 12 Apr 2002 16:33:53
Message: <3CB743C8.C1816CA2@taconic.net>
#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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.