|
|
"Thomas de Groot" <t.d### [at] internlDOTnet> wrote:
> Yes, the following piece of code, using eval_pigment, gets me a fatal parse
> error: out of memory, while the same code by Kenneth, does not. tested with
> version 3.7 beta 25.
Hi,
First off, quite a clever idea, props Kenneth.
Secondly, I haven't yet tried it, but I believe both parse time and memory
usage could be much improved by declaring a function from the pigment once and
then calling the function to get the appropriate value. This would avoid
declaring the pigment function (which is what eval_pigment does) over and over
again for the same pigment, and replace a repeated macro call with a function
call, which should be much faster.
So for example, before the loop:
#declare Pig_F = function { pigment { Mask } }
Then, instead of eval_pigment:
// For Greyscale images
#declare Intersection = Pig_F(Position.x, Position.y, Position.z).red;
or
// For RGB images
#declare Intersection = Pig_F(Position.x, Position.y, Position.z).gray ;
-The Mildly Infamous Blue Herring
Post a reply to this message
|
|