POV-Ray : Newsgroups : povray.general : colors map interpolation : Re: colors map interpolation Server Time
28 Mar 2024 21:04:40 EDT (-0400)
  Re: colors map interpolation  
From: kurtz le pirate
Date: 22 Nov 2022 11:02:51
Message: <637cf2ab$1@news.povray.org>
On 22/11/2022 13:11, Tor Olav Kristensen wrote:

> 
> Hi Kurz

Hello

> I don't know if it was your intention to not extract the filter and
> transmit components of the color.

Yes, in this case, I am not interested in the values of t and f.
I want to use the color_map as a lookup table to draw the julia sets.


> If you write the macro like this:
> 
> 
> #macro GetColor(ThisColorMap, ThisEntry)
> 
>     #local Index = max(0.0, min(ThisEntry, 1.0));
>     #local Gradient = pigment { gradient x color_map { ThisColorMap } }
>     #local GradientFunction = function { pigment { Gradient } };
>     #local Color = color GradientFunction(Index, 0, 0);
> 
>     Color
> 
> #end // macro GetColor
> 
> 
> - then it will extract all the color components.
> 
> You'll also get a faster macro because of only one call to the pigment
> function instead of three.

Well seen !
Thanks




-- 
Kurtz le pirate
Compagnie de la Banquise


Post a reply to this message

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