[Radiance-general] RE: Sun Color

Martin Moeck MMoeck at engr.psu.edu
Sat Jan 8 14:46:01 CET 2005


I modified the script.Use it as follows:
 
# generate a radiance sun:  gensky 3 21 8
...
void light solar
0
0
3 5.18e+006 5.18e+006 5.18e+006
...
YL=179*(5.18e+006 *.265+5.18e+006 *.67+5.18e+006*.0648)= 927034556
 
 
proc Kelvin_to_sun_RGB {T YL} {

# converts a color temperature of degrees Kelvin into RGB
# given: color temp. T and the luminance YL of the source
# convert the blackbody temperature T into "RGB"
# Both fits have R^2= 1.000 over the range from 2000K
# to 11000K. Both look ill behaved above 11000K
set x [expr 0.8405 - 2.17834e-04 *$T  \
                   + 3.52544e-08 *$T*$T \
                   - 2.7046e-12*$T*$T*$T \
                   + 7.9696e-17*$T*$T*$T*$T]
set y [expr 0.30587 + 1.3655e-4 *$T \
                    - 5.6154e-8 *$T*$T \
                    + 8.9484e-12*$T*$T*$T \
                    - 6.5352e-16*$T*$T*$T*$T \
                    + 1.8158e-20*$T*$T*$T*$T*$T]

set z [expr 1.0-$x-$y]
set X [expr $x*$YL/$y]
set Z [expr $z*$YL/$y]
# X, YL, Z are the spectral tristimulus values
# the following formulae assume the monitor alignments given in the book :
# "procedural elements for computer graphics" by David F. Rogers, 1985 McGraw-Hill; pp. 397
set R [expr  2.739*$X - 1.145*$YL - 0.424*$Z]
set G [expr -1.119*$X + 2.029*$YL + 0.033*$Z]
set B [expr 0.138 *$X - 0.333*$YL + 1.105*$Z]
if {$B<0} {set B 0.0}
return "$R $G $B"
}
__________________________________
Kelvin_to_sun_RGB 2100.0 $YL
...
# a sun with a color temperature of 2100 K and a luminance of YL
void light solar
0 0 3
2017646607     601412803   19892974
...

The script does not work for very low sun angles, as the sun changes to pink orange, which cannot be represented by a blackbody. Use some filter colors from Lee or Rosco for that. 
 
Martin Moeck
 
 

	-----Original Message----- 
	From: Marcus Jacobs [mailto:marcdevon at hotmail.com] 
	Sent: Fri 1/7/2005 8:10 PM 
	To: radiance-general at radiance-online.org 
	Cc: 
	Subject: [Radiance-general] RE: Sun Color
	
	

	Thanks Martin and Greg for the help for my question about the sun color.
	
	
	I have done some light research on of the sun's color temperature. I think
	Martin's may be the method that I would prefer in converting a color
	temperature and luminance of the sun to the RGB used with the light
	primative. I have had some problems running the script. In a comment line it
	states:
	
	
	converts a color temperature of degrees Kelvin into RGB given: color temp. T
	and the luminance YL of the source
	
	
	My problem is that this script takes three variables (T, YL, and
	solar_radiance) but the comment only mentions two variables (T and YL). What
	is the solar_radiance and how does it differ from the luminance of the
	source (the source I am assuming is the sun)? Also, what are the units of
	measurement for the 3 variables? Do you have an example for this?
	
	Thanks
	
	Marcus Jacobs
	
	
	
	_______________________________________________
	Radiance-general mailing list
	Radiance-general at radiance-online.org
	http://www.radiance-online.org/mailman/listinfo/radiance-general
	

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/ms-tnef
Size: 7506 bytes
Desc: not available
Url : http://radiance-online.org/pipermail/radiance-general/attachments/20050108/44e7f9e2/attachment.bin


More information about the Radiance-general mailing list