POV-Ray : Newsgroups : povray.general : Rendering colors outside of RGB space : Re: Rendering colors outside of RGB space Server Time
30 Jul 2024 16:21:42 EDT (-0400)
  Re: Rendering colors outside of RGB space  
From: clipka
Date: 9 Apr 2009 13:00:01
Message: <web.49de286b469723b6b06defeb0@news.povray.org>
"MessyBlob" <nomail@nomail> wrote:
> What you're looking for falls in the 'frequency' gamut problem (see above), and
> demands a spectral approach (see above), which is beyond the capabilities of
> POV-Ray.

Is it?

SDL can do quite a lot of stuff; e.g. you could render an "animation" cycling
through narrow spectral bands, using a smart macro to pick different colors
based on spectra you define. Something like:


#if (frame_number < 3)

// in frames 0-2, we render the scene using different discrete spectral bands
// (imagine us illuminating the scene with e.g. a Hg vapor lamp, a genuine
// neon lamp, or whatever lamp you have to give you narrow spectral emission,
// and changing light sources from frame to frame)
// building what would basically be false-color images of the scene

#macro ColorFromSpectrum(q1,q2,q3,q4,q5,q6,q7,q8,q9)
#switch (frame_number)
#case (0):
  rgb <q1,q4,q7>
#break
#case (1):
  rgb <q2,q5,q8>
#break
#case (2):
  rgb <q3,q6,q9>
#break
#end

....

sphere { <0,0,0>, 1
  pigment { color ColorFromSpectrum(0.2,0.3,0.7,0.5,0.2,0.2,0.1,0.3,0.0) }
  finish { ...}
}

....

#else

// now, in the final frame, we build an orthographic scene,
// using the previously rendered false-color frames as input for some
// smart functions to transform the results into a color space
// of our liking

// I'll leave the exact details out here because I'm not a color space
// transformation expert, and too lazy to look up the exact syntax;

// The basic procedure would be to make pigment functions from the
// rendered frames to retrieve the individual values,
// compose functions from these that each compute a result color channel,
// and use some pigment averaging to compose the color channels together.

#end


Post a reply to this message

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