|Image created by Robert A. Rohde / Global Warming Art|
I implemented the spectral irradiance of the sun based on modern AM0 data. AM0 (Air Mass Zero) means that the data is for sunlight that hasn't passed through any atmosphere, which is what I needed because I am simulating the atmosphere myself. This extraterrestrial spectral solar irradiance data is often used for space applications. AM1.5 data is also available, for ground level applications such as solar energy. I found the data on NREL's website, and it originally came from a 2003 paper by Guemard. In my renderer I convert irradiance to radiance instead of using the data directly. Previously, I was using a constant value for the sun's energy, uniform across the spectrum. I could have alternatively used a black body radiation curve to approximate the spectral irradiance, however spectral solar irradiance does not exactly follow a black body radiation curve.
Here are some renders comparing the new and old solar spectra. To clearly see the differences, you can click an image to bring it up in the lightbox, then you can then switch between images. One of the most noticeable differences is that the new images are bluer.
To use the spectral solar irradiance data, I wrote a LookupTable class with a custom binary search and linear interpolation, and then made a SpectralSolarIrradiance subclass with an array of wavelength keys and spectral irradiance values. I made another subclass of LookupTable called RayleighScatteringDepolarizationFactor to store the depolarization factor data for Rayleigh scattering. I could also make my CIEXYZColorMatchingFunctions class extend the LookupTable superclass, however it currently uses optimized code that I wrote specifically for data given in uniform increments. I will probably also use the LookupTable class for ozone absorption data. Ozone absorption is an important factor that I will write about in a future post. I also now have new classes for USStandardAtmosphere1976, RayleighScattering, which I didn't write right away just because the code was in a lot of flux. I'll post more information about the structure of my code another time.