POV-Ray : Newsgroups : povray.general : eval_pigment? : Re: eval_pigment? Server Time
19 Apr 2024 06:05:29 EDT (-0400)
  Re: eval_pigment?  
From: Bald Eagle
Date: 20 Nov 2022 21:00:00
Message: <web.637adb44287863e91f9dae3025979125@news.povray.org>
"Tor Olav Kristensen" <tor### [at] TOBEREMOVEDgmailcom> wrote:

> I don't think that what I suggesting is trying to mask anything. It is just an
> attempt to make robust macros that doesn't create strange problems for the
> users.

The masking is just something that happens incidentally - people know if
eval_pigment, but have no idea how it works.  It becomes POV-Ray magic by
default.


> Yes, in user created code, like the code you just posted, I think it is all ok
> to name functions. I think your code was relatively easy to understand. But in
> include files for use by many others I think we should be careful.

Indeed.   Bill Pokorny, jr, myself, and others have run into that namespace
problem.


> Today, after you posted your code in the "colors map interpolation" thread, I
> learnt a new thing about splines. I was about to suggest that this code be used
> to return color vectors corresponding to the colors in the color map:
>
> #declare VectorSpline =
>     spline {
>         linear_spline
>         0.00, <1.00, 0.00, 0.00>,
>         0.50, <1.00, 1.00, 0.00>,
>         1.00, <0.00, 0.00, 1.00>
>     }
>
> But I found that the interpolation in splines, does not happen in the same way
> as in color maps.

Try again, but be aware that POV-Ray uses different types of interpolation with
the different blend modes.

https://wiki.povray.org/content/Reference:Color_Map

I'm sure your spline is using linear interpolation, whereas the default might be
 in sRGB space.  It's extremely confusing until you get how all the "color math"
works in context, and even then I tend to run into problems or get it completely
backwards.


Post a reply to this message

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