POV-Ray : Newsgroups : povray.binaries.images : LightsysIV spectrum Server Time
8 Nov 2024 10:27:19 EST (-0500)
  LightsysIV spectrum (Message 1 to 10 of 20)  
Goto Latest 10 Messages Next 10 Messages >>>
From: Cousin Ricky
Subject: LightsysIV spectrum
Date: 3 Oct 2012 22:05:01
Message: <web.506cede343e4d6085de7b680@news.povray.org>
No, this has nothing to do with spectral rendering.  Sorry to disappoint.
______________________________________________________________________

#include "CIE.inc"

#declare SHORTEST = 378;
#declare LONGEST = 826;
#declare STEP = 2;

#declare Max = 0;
#declare c_Values = array [(LONGEST - SHORTEST) / STEP + 1]
#local I = 0;
#for (Wl, SHORTEST, LONGEST, STEP)
  #declare c_Values[I] = MapGamut (Wavelength2RGB (Wl));
  #declare Max = max (Max, c_Values[I].x, c_Values[I].y, c_Values[I].z);
  #local I = I + 1;
#end

#declare cm_Spectrum = color_map
{ #local I = 0;
  #for (Wl, SHORTEST, LONGEST, STEP)
    [Wl/1000 rgb c_Values[I] / Max]
    #local I = I + 1;
  #end
}

#declare p_Spectrum = pigment { gradient x color_map { cm_Spectrum } }
______________________________________________________________________

P.S.  Macro MapGamut() has the same pass-by-reference issue that CH2RGB() used
to have.  (See "CH2RGB somehow causes infinite loop" in p.general.)


Post a reply to this message


Attachments:
Download 'ls4_spectrum_montage1.png' (16 KB)

Preview of image 'ls4_spectrum_montage1.png'
ls4_spectrum_montage1.png


 

From: Cousin Ricky
Subject: Re: LightsysIV spectrum
Date: 3 Oct 2012 22:15:00
Message: <web.506cf08f4b06c52e85de7b680@news.povray.org>
Oh yeah, if the #for keyword didn't give it away, you need POV-Ray 3.7 (or
manually convert the #for loops to #while loops).

Here is a graph of the sRGB primaries as a function of wavelength.


Post a reply to this message


Attachments:
Download 'ls4_spectrum2rgb.png' (33 KB)

Preview of image 'ls4_spectrum2rgb.png'
ls4_spectrum2rgb.png


 

From: Jaime Vives Piqueres
Subject: Re: LightsysIV spectrum
Date: 4 Oct 2012 02:16:10
Message: <506d29aa@news.povray.org>
On 04/10/12 04:12, Cousin Ricky wrote:
> #for

   What? ...I really should take a better look at that "new features"
page on the wiki.

--
Jaime


Post a reply to this message

From: Thomas de Groot
Subject: Re: LightsysIV spectrum
Date: 4 Oct 2012 03:15:55
Message: <506d37ab$1@news.povray.org>
On 4-10-2012 8:16, Jaime Vives Piqueres wrote:
> On 04/10/12 04:12, Cousin Ricky wrote:
>> #for
>
>    What? ...I really should take a better look at that "new features"
> page on the wiki.

He he! I also totally forgot about that feature... ;-)

[but that is not Ricky's point in his original post of course]

Thomas


Post a reply to this message

From: Ive
Subject: Re: LightsysIV spectrum
Date: 4 Oct 2012 10:58:07
Message: <506da3ff@news.povray.org>
Am 04.10.2012 04:01, schrieb Cousin Ricky:
> P.S.  Macro MapGamut() has the same pass-by-reference issue that CH2RGB() used
> to have.  (See "CH2RGB somehow causes infinite loop" in p.general.)
>

I see. I've corrected it for my distribution of CIE.inc within the 
LS_SpectralRender.zip file.

Thanks
-Ive


Post a reply to this message

From: Ive
Subject: Re: LightsysIV spectrum
Date: 4 Oct 2012 11:01:37
Message: <506da4d1@news.povray.org>
Am 04.10.2012 08:16, schrieb Jaime Vives Piqueres:
> On 04/10/12 04:12, Cousin Ricky wrote:
>> #for
>
>    What? ...I really should take a better look at that "new features"
> page on the wiki.
>
The #for loop is there since years! And it is an important feature for 
lazy people ;)

-Ive


Post a reply to this message

From: Thomas de Groot
Subject: Re: LightsysIV spectrum
Date: 6 Oct 2012 10:07:12
Message: <50703b10@news.povray.org>
On 4-10-2012 16:56, Ive wrote:
> I see. I've corrected it for my distribution of CIE.inc within the
> LS_SpectralRender.zip file.


Thanks, and got it.

I suppose Jaime should also update his Lightsys page. ;-)

Thomas


Post a reply to this message

From: Jaime Vives Piqueres
Subject: Re: LightsysIV spectrum
Date: 8 Oct 2012 02:54:20
Message: <5072789c$1@news.povray.org>
On 06/10/12 16:07, Thomas de Groot wrote:
> On 4-10-2012 16:56, Ive wrote:
>> I see. I've corrected it for my distribution of CIE.inc within the
>>  LS_SpectralRender.zip file.
>
>
> Thanks, and got it.
>
> I suppose Jaime should also update his Lightsys page. ;-)


   Yes, that page and a lot more... I was supposed to update the site
this summer, but I'm a bit late. Man, I really have a severe case of "I
should be doing something else"!

   OK, will do it this week, as I have a lot of unpublished images and
experiments, and it can get ugly if I let it to continue like this...

--
Jaime


Post a reply to this message

From: Thomas de Groot
Subject: Re: LightsysIV spectrum
Date: 8 Oct 2012 03:06:44
Message: <50727b84$1@news.povray.org>
On 8-10-2012 8:54, Jaime Vives Piqueres wrote:
>> I suppose Jaime should also update his Lightsys page. ;-)
>
>
>    Yes, that page and a lot more... I was supposed to update the site
> this summer, but I'm a bit late. Man, I really have a severe case of "I
> should be doing something else"!

I know what you mean :-)

>
>    OK, will do it this week, as I have a lot of unpublished images and
> experiments, and it can get ugly if I let it to continue like this...

Looking forward to that! And take your time. No need to do a hasty job.

Thomas


Post a reply to this message

From: Jaime Vives Piqueres
Subject: Re: LightsysIV spectrum
Date: 8 Oct 2012 03:17:56
Message: <50727e24$1@news.povray.org>
On 08/10/12 09:06, Thomas de Groot wrote:
> Looking forward to that! And take your time. No need to do a hasty
> job.

   My real problem is that I naively decided years ago to offer a
bilingual site... so the amount of work needed for any update is almost
twice (the files are shared between both sites, but I need to translate
the texts, and I'm not very fast at it).

--
Jaime


Post a reply to this message

Goto Latest 10 Messages Next 10 Messages >>>

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