|
|
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'
|
|