POV-Ray : Newsgroups : povray.advanced-users : D65 spectral locus Server Time
29 Mar 2024 09:56:31 EDT (-0400)
  D65 spectral locus (Message 11 to 16 of 16)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: clipka
Subject: Re: D65 spectral locus
Date: 19 Mar 2017 18:30:05
Message: <58cf066d$1@news.povray.org>
Am 19.03.2017 um 23:04 schrieb Mike Horvath:

> Did you use a function to color the shape, or did you color each
> triangle in a solid color? I am doing the latter at the moment using the
> xyz2RGB() macro that comes with Lightsys. It works okay, but you can see
> each and every triangle as a result. I don't like that.
> 
> I also tried re-using the function I used to color the sRGB gamut, and
> the result is very wonky and random looking. Not good.

I used an average of three function pattern pigments, each representing
the R, G or B component, respectively (multiplied by 3, so that the
average effectively implemented a sum), of the colour space in question
(CIE xyY in the particular case).

The functions did not go via sRGB, but straight from xyY to XYZ and from
there to linear RGB (with sRGB primaries).

As the entire shape is outside the linear RGB gamut, a straightforward
implementation of the functions would inevitably have exceeded the 0..1
range, and thus have caused undesired wraparound in the function
pattern; I therefore designed the functions to nominally return values
in the range from 0.5 to 0.6, and chose the colour map in a manner to
compensate (using e.g. `color_map{[0, red -5*3][1, red 5*3]}` for the
red component; note that the values of -5 and +5 compensate for the
uncommon nominal function range, while the factor of 3 is the one
required to effectively turn the average into a sum).


Post a reply to this message

From: Mike Horvath
Subject: Re: D65 spectral locus
Date: 19 Mar 2017 20:07:51
Message: <58cf1d57$1@news.povray.org>
On 3/19/2017 6:30 PM, clipka wrote:
> As the entire shape is outside the linear RGB gamut, a straightforward
> implementation of the functions would inevitably have exceeded the 0..1
> range, and thus have caused undesired wraparound in the function
> pattern; I therefore designed the functions to nominally return values
> in the range from 0.5 to 0.6, and chose the colour map in a manner to
> compensate (using e.g. `color_map{[0, red -5*3][1, red 5*3]}` for the
> red component; note that the values of -5 and +5 compensate for the
> uncommon nominal function range, while the factor of 3 is the one
> required to effectively turn the average into a sum).
>

I was able to do this. The result is colors that are kind of dull and 
muted. Is there a way to brighten them up?

Also, I don't understand why I can color each triangle by converting XYZ 
to RGB and have the result look okay, but when I try to do the same 
thing with a function the result is messed up (unless I follow your method).

Weird.


Mike


Post a reply to this message

From: Mike Horvath
Subject: Re: D65 spectral locus
Date: 19 Mar 2017 20:20:55
Message: <58cf2067$1@news.povray.org>
On 3/19/2017 8:08 PM, Mike Horvath wrote:
> I was able to do this. The result is colors that are kind of dull and
> muted. Is there a way to brighten them up?
>
> Also, I don't understand why I can color each triangle by converting XYZ
> to RGB and have the result look okay, but when I try to do the same
> thing with a function the result is messed up (unless I follow your
> method).
>
> Weird.
>
>
> Mike

Never mind. I forgot that when coloring the triangles I had also turned 
on emission. Fixed now.


Mike


Post a reply to this message

From: clipka
Subject: Re: D65 spectral locus
Date: 20 Mar 2017 08:14:30
Message: <58cfc7a6$1@news.povray.org>
Am 20.03.2017 um 01:08 schrieb Mike Horvath:
> On 3/19/2017 6:30 PM, clipka wrote:
>> As the entire shape is outside the linear RGB gamut, a straightforward
>> implementation of the functions would inevitably have exceeded the 0..1
>> range, and thus have caused undesired wraparound in the function
>> pattern; I therefore designed the functions to nominally return values
>> in the range from 0.5 to 0.6, and chose the colour map in a manner to
>> compensate (using e.g. `color_map{[0, red -5*3][1, red 5*3]}` for the
>> red component; note that the values of -5 and +5 compensate for the
>> uncommon nominal function range, while the factor of 3 is the one
>> required to effectively turn the average into a sum).
>>
...

> Also, I don't understand why I can color each triangle by converting XYZ
> to RGB and have the result look okay, but when I try to do the same
> thing with a function the result is messed up (unless I follow your
> method).

That's because when you colour individual triangles you're using the
colour conversion function directly; but when you're using (an average
of multiple) function pigments, the function is used via a pattern,
where an implicit mod(f,1) is applied to the function, wrapping around
values outside the range 0..1 (e.g. a function value of 1.1 gets
translated to a colour map index of 0.1).

Or at least that's what I presume you're seeing. Been there, seen that.


Post a reply to this message

From: Mike Horvath
Subject: Re: D65 spectral locus
Date: 21 Mar 2017 21:43:20
Message: <58d1d6b8$1@news.povray.org>
On 3/20/2017 8:14 AM, clipka wrote:
>> Also, I don't understand why I can color each triangle by converting XYZ
>> to RGB and have the result look okay, but when I try to do the same
>> thing with a function the result is messed up (unless I follow your
>> method).
>
> That's because when you colour individual triangles you're using the
> colour conversion function directly; but when you're using (an average
> of multiple) function pigments, the function is used via a pattern,
> where an implicit mod(f,1) is applied to the function, wrapping around
> values outside the range 0..1 (e.g. a function value of 1.1 gets
> translated to a colour map index of 0.1).
>
> Or at least that's what I presume you're seeing. Been there, seen that.
>

Is there a way to disable the wrapping using a keyword? It might make a 
nice feature addition.


Mike


Post a reply to this message

From: clipka
Subject: Re: D65 spectral locus
Date: 21 Mar 2017 22:07:27
Message: <58d1dc5f$1@news.povray.org>
Am 22.03.2017 um 02:43 schrieb Mike Horvath:
> On 3/20/2017 8:14 AM, clipka wrote:
...
>> That's because when you colour individual triangles you're using the
>> colour conversion function directly; but when you're using (an average
>> of multiple) function pigments, the function is used via a pattern,
>> where an implicit mod(f,1) is applied to the function, wrapping around
>> values outside the range 0..1 (e.g. a function value of 1.1 gets
>> translated to a colour map index of 0.1).
...
> Is there a way to disable the wrapping using a keyword?

Nope.

Not yet, that is. I have a plan to implement this as a kind of special
wave type; but on that occasion I would like to re-implement some of the
existing patterns to also provide a "no-wrap mode", which requires a bit
of thought and care.


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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