The desire for accuracy and realism in images requires a physically-based rendering system. Often this can mean using a full spectral representation, as RGB representations have limitations in some situations[4]. The spectral representation does come at some cost, not the least of which is that most available models and model formats specify materials and lights in terms of RGB triples. Using these models conveniently requires the conversion of RGB values into spectra [2]. The conversion process should result in spectra that are suitable for use in a physically based rendering system and be efficient, both for data import and for texturing operations.
The main difficulty in converting from RGB to spectra is that for any positive RGB color there are an infinite number of spectra that can produce that color. These spectra are known as metamers of each other. Although these spectra all produce the same color, when they are used as reflectances and illuminated by non-constant spectra the resulting spectra are usually not metamers. There is not enough information to determine which of the metamers for a particular color is the ``right'' metamer. Instead, the goal is to pick a ``good'' metamer.
In the physical world, spectra are functions defined over some continuous range of wavelengths. This is an impractical representation for a rendering algorithm, so a finite dimensional representation must be chosen. These range from piecewise constant basis functions to optimally chosen point samples [6] to optimal basis functions for a specific scene [8]. This paper uses piecewise constant spectra, as the relatively narrow and non-overlapping support of the basis functions make them efficient to use and capable of representing fairly saturated colors. Since they cover every wavelength in the visible spectrum, the filtering issues raised by point samples are handled automatically. For the rest of this paper, a spectrum will refer to a vector of weights for a set of piecewise constant basis functions.
The linear transform from a spectrum to the RGB color space is defined by the standard XYZ matching functions and the matrix converting from XYZ to RGB as described in many sources (e.g. Rogers [11], Wyszecki and Stiles[16]). Note that the XYZ matching functions are defined from 360nm to 800nm, while in practice rendering systems usually use a significantly smaller interval in order to focus on the region where the eye is more sensitive.
Most of the colors that will need to be transformed while reading in a model, or while doing texture mapping are reflectances. Reflectances should all be between zero and one in order to satisfy physical laws. Reflectances of natural materials also tend to be smooth[5]. Additionally, spectra with a minimal amount of variation are better for computational reasons. This can be seen by looking at two possible representations for 50% grey in Figure greys. Although both are the same color, they perform very differently in a rendering system. The results of multiplying the two curves can be seen in Figure products. None of the resulting curves are grey or average 25%. A global illumination algorithm using Grey2 would diverge very quickly, while a rendering system using Grey1 or a combination would produce unintuitive results and visually disturbing color shifts. These cases are both possible in the real world, however, they don't match our intuition of a grey surface illuminated by a white light resulting in a grey appearance. Minimal variation over the spectrum, with peaks and troughs being as wide and as close to average as possible, reduce these problems.
Previous approaches to converting RGB colors to spectra have not
focused on creating spectra that are suitable for reflectances. One
approach [3] takes the spectra for each of the
three phosphors and weights them by the RGB triple. This obviously
works, however the spectra for the phosphors are quite irregular,
resulting in reflectances that are significantly greater than 1, and a
white RGB results in a spectrum that is far from constant. Other
approaches by Glassner [2] and Sun
[14] choose three smooth functions and use linear
combinations of those functions based on the RGB values. These
approaches can result in spectra with negative regions.
A last and simplest approach was used by Shirley and
Marschner [12]. This approach simply uses the blue
value for the first n/3 coefficients, the green value for the next
n/3, and the red for the last. The number of basis functions were
constrained to be a multiple of 3. This method does not produce a
spectrum that converts to the right color, but it can be fairly close,
and results in spectra that are guaranteed to be valid reflectances.
The method is tailored to spectra defined over the interval [400,700]
and does not work satisfactorily for intervals significantly different
than this. The resulting curves also did not look very plausible.
Ideally, a good conversion for reflectances would have the bounded
properties of the Shirley and Marschner approach and the smoothness
and exact match properties of the method described by Glassner.
Comments: Brian Smits