POV-Ray : Newsgroups : povray.advanced-users : Lightsys IV and SpectralRender yield different light levels : Re: Lightsys IV and SpectralRender yield different light levels Server Time
3 May 2024 08:52:44 EDT (-0400)
  Re: Lightsys IV and SpectralRender yield different light levels  
From: scott
Date: 28 Jul 2016 03:18:09
Message: <5799b1b1$1@news.povray.org>
>> What units are the return value from CMF_xyz (specifically, is it nm^-1
>> or does it return the xyz for a 10nm band width)? I suspect you need to
>> multiply the value by 10 if you are using 10 nm width spectral bands.
>>
>> Also I don't see why you need the Acc/36 line, the result should be the
>> sum of all the wavelength contributions, not the average.
>>
>> If you change those two things, does the below give the correct result?
>>
>> #declare Acc = <0, 0, 0>;
>> #for (I, 0, 35)
>>   #local Wl = 380 + I * 10;
>>   #declare Acc = Acc + CMF_xyz (Wl) * 10 * LEVEL; // Illuminant E
>>   #end
>> #declare C = Acc;
>
> It's even worse:
 >
> xyz <53.4116, 53.4265, 53.3845>
> rgb <64.3517, 50.6749, 48.5072>

It's quite common in colour stuff to use a scale of 0-100 (per cent) 
rather than 0-1. It seems like this is what is happening here. You just 
need to divide by 100 to match the units of your image sampling.

You definitely don't want to divide by 10, that is unrelated, and just a 
fudge that will happen to work because you are using 10nm bands (and 
10*10=100). You need to multiply by the band width to get the correct 
result. For example, if you happened to use 5nm bands:

#declare Acc = <0, 0, 0>;
#for (I, 0, 70)
   #local Wl = 380 + I * 5;
   #declare Acc = Acc + CMF_xyz (Wl) * 5 * LEVEL; // Illuminant E
   #end
#declare C = Acc / 100; // convert from % to 0...1 scale

You should get the same answer (roughly) for any reasonable bandwidth 
you decide to use.


Post a reply to this message

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