POV-Ray : Newsgroups : povray.pov4.discussion.general : Builtin color spaces, spectral colors? : Re: Builtin color spaces, spectral colors? Server Time
18 May 2022 19:57:43 EDT (-0400)
  Re: Builtin color spaces, spectral colors?  
From: clipka
Date: 24 Mar 2013 20:56:39
Message: <514fa0c7@news.povray.org>
Am 21.03.2013 02:40, schrieb Simon Copar:
> I'm just wondering: is there a plan to extend SDL to allow more than jst rgb
> color spaces?

Not at present.


> On a similar note, if povray4 goes natively spectral, how will this be handled?

I'm nor sure wheter spectral rendering will be implemented in mainstream 
POV-Ray at all. It probably depends on how well spectral rendering will 
perform in a patched version of 3.7 created by some 3rd party (which 
might eventually be me).

> In my mind, I see a block in global_settings that specifies the color mode:
> choose rgb or spectral, possibly with a number specifying how many samples to
> use,

Yes, that does seem sensible. Of course for the render core it all boils 
down to N-channel rendering, but rgb mode needs some special treatment 
at the boundaries of the core, since it's not a spectral model.

It might also make sense to provide a way to specify the frequencies of 
the individual channels; this way, a user could e.g. have POV-Ray use 
more channels in the yellow region for a scene with sodium lamps.

> and of course, a mapping function to get back from spectrum to rgb
> (nontrivial, there are several different spectral response function models that
> try to approximate the human eye, or a display device).

Until now I'd have expected that to be the least problem: Just choose 
one of the two CIE standard observers, use the response functions to 
convert to XYZ, and from there to whatever color space is chosen for output.

 > In the spectral mode, I
> think that colors specified as rgb could be modeled using a default response
> function for r,g,b (let's say, the response functions of the eye),

I guess this is actually the hardest nut to crack.

The most straightforward approach would of course be to pick a set of of 
real-life or synthesized phosphors with known emission curves; we'd then 
first convert from scRGB to the RGB color space defined by those 
phosphors, and then multiply each color component by the corresponding 
phosphor's spectrum.

However, I don't like this approach, as it would still be strongly 
biased towards red, green and blue hues, in the sense that filters of 
those hues attenuate light of the same hue less than would be the case 
with yellow, cyan or purple hues. I'd rather prefer a spectrum synthesis 
algorithm where the attenuation of a given filter depends only on 
brightness and saturation.

> but one could
> also specify colors as functions of the wavelength: point-wise specified spectra
> (which could be specified in a big .inc file). Something like
>
> pigment {
>    gradient z
>    color_map {
>      [0 color rgb <1,0.5,0>] // actually 1*CIE_red+0.5*CIE_green
>      [1 color spectral <440:0.1,550:0.4,600:0.6,700:1>] //linear interpolation
> between specified wavelengths
>    }
> }

I haven't spent much thought on the syntax yet, but I do like this one.

> Is it reasonable to expect something like that?

Yup. If you have any additional ideas along these lines, feel free to 
let your thoughts go wild.


Post a reply to this message

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