POV-Ray : Newsgroups : povray.advanced-users : Reproducing pigment from functions ... : Reproducing pigment from functions ... Server Time
29 Jul 2024 12:17:13 EDT (-0400)
  Reproducing pigment from functions ...  
From: Michael Andrews
Date: 10 Apr 2002 09:03:40
Message: <3CB43A2F.651B5B6@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]} ]
  }
}

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

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