POV-Ray : Newsgroups : povray.advanced-users : Reconstructing full color pigment pattern : Re: Reconstructing full color pigment pattern Server Time
23 Jun 2021 13:04:57 EDT (-0400)
  Re: Reconstructing full color pigment pattern  
From: Tor Olav Kristensen
Date: 16 Jul 2019 19:50:01
Message: <web.5d2e61b48425f2c5264be49d0@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> So,
> With regard to pigment functions, I was wondering how one might go about
> [re]producing the full color [rgb] version of the the pattern.

Bill, please note that patterns do not have colors. They just return a single
float value for every point in 3D space. They can be used for various purposes,
like looking up colors, pigments, textures, normals etc. in maps and for
controlling media density. They can also be used in functions, like this:

#declare BozoFn = function { pattern { bozo } };

(Note that this is not a vector-valued function, as it only returns a float

> When something like this is done:
> #declare Pattern = function {pigment{bozo}}
> Am I correct that this is a function that can return a vector result?

Yes, pigment functions are vector-valued, as they return a color vector. Try

#version 3.7;

#declare PigmentFn =
    function {
        pigment {
            rgb <0.4, 0.1, 0.9>
            rgb <0.7, 0.3, 0.2>

#declare pA = <1.4, -3.1, 5.2>;
#declare pB = <2.4, -3.1, 5.2>;

#declare ColorA = PigmentFn(pA.x, pA.y, pA.z);
#declare ColorB = PigmentFn(pB.x, pB.y, pB.z);

#debug "\n"
#debug concat("<", vstr(3, ColorA, ", ", 0, -1), ">")
#debug "\n"
#debug concat("<", vstr(3, ColorB, ", ", 0, -1), ">")
#debug "\n"
#debug "\n"

> Is there a way to create a full-color pigment?

Perhaps you can find something useful in my Gaussian_Blur.inc file, here:


(You could, for example look at the PigmentRGBFT() function.)

Tor Olav

Post a reply to this message

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