Spectrums and Spectral Images
Spectral aspect of the light
Light is a wave traveling in space. Its wavelength is the length of each oscillation (Figure A).
The wavelength defines the color that is perceived : a wave with a wavelength of 400nm will be perceived as blue and a wave with a wavelength of 700nm will be perceived as red (Figure B).
Some wavelengths cannot be perceived by the human eye (infrared above 830 nm, uv and x-rays below 360 nm).
figure A
figure B
https://www.chem.fsu.edu/chemlab/chm1045/estructure.html
Most light sources do not emit light at a single wavelength but they emit a combination of multiple wavelengths with different intensities. All of these wavelengths make up the light spectrum.
intensity as a function of wavelength, example of a spectrum perceived as blue
The way we perceive the appearance of materials also depends on their spectral characteristics : the material reflects, diffracts and absorbs the light depending on its wavelength. Some examples of situations where the spectral characteristics of a material has an influence on its appearance could be :
two materials that can be perceived as similar under a light source and different under another (example 1)
very thin layers of reflective/transmissive material (soap bubbles, very thin coatings,...) that can create interference (example 2)
materials with refractive index that depends on the wavelength (glass, diamond,...) that can induce dispersion (example 3)
...
Example 1 : metameric materials under a D65 illuminant (left) and a F10 illuminant (right)
Example 2 : interference in soap bubbles
Example 3 : dispersion in a diamond or in prisms
Spectrums in the Predict Suite
In the Predict Suite, spectrums are required to define materials, lights, and sensors. Spectrums can be defined in various ways (see details bellow).
Spectrum fields are represented by a colored rectangle representing the intensity of each wavelength. You can click anywhere on the spectrum field or the "..." button to open the spectrum inspector.
A small square on the left of the spectrum field contains the spectrum preview color. The preview color is only an approximation of the color that can be generated by this spectrum, be aware that this color depends on the sensor that is used, and on the general context in which the spectrum is used : for instance, a material spectrum depends on the light that illuminates it (D65 by default).
You can change the illuminant spectrum that is used to compute the color preview for material spectrums in the PredictSuite preferences, section Matter Settings.
Spectrum Inspector
The spectrum inspector is built as follow :
The spectrum is defined by a type and type-dependent settings (see section "Spectrum definitions" bellow for more details) (1),
A preview of the spectrum is displayed on the bottom part (2), the background color of the preview is an approximation of what the spectrum represents in RGB (see details in section above),
Additional settings for the preview are available bellow the curve (3),
Copy, Paste, and Save options are available above the curve (4),
The "Info" button (4) reveals details on how to navigate inside the spectrum preview (see section "Navigating the spectrum view" bellow for more details),
The "Spectrum" button (4) opens a conversion menu : this menu enables you to convert any kind of spectrum to a raw, editable spectrum (see section "Editing the spectrum" bellow for more details).
Spectrum definitions
Spectrums can be defined with the following types :
RGB : the spectrum is computed from an RGB color, the up-sampling is done according to [Smits,99].
Preset : the spectrum is a preset measured illuminant (D65, Sun, …),
Measured : the spectrum is given in a .xml file,
The xml file should be formatted as follow:
<material type="Spectral">
<entry k="1.306" n="1.422" wavelength="206.64" />
<!-- ... -->
<entry k="15.5" n="1.205" wavelength="2479.7" />
</material>
Each entry contains the sampled quantities at the specified wavelength in nanometer.
The "wavelength" is a reserved and mandatory keyword. For the corresponding quantities, there exists common keywords such as "n", "k", "value", "x", "y", "z", "r", "g", "b" but custom ones are accepted too. If the sampling is the same for multiple quantities, they can be put inside the same <entry>.
Constant : the spectrum returns a given value for every wavelength.
If the "Infinite Range" toggle is not enabled, the value will be returned inside the range only and the spectrum will return 0 outside the range,
Sun Emission : this is a model of the sun emission spectrum (Preetham), the spectrum is computed from the position of the observer on the earth and the date, time and conditions of the observation.
Blackbody : the spectrum is a black body at a given temperature,
Cauchy : the spectrum is defined by the following equation, where the Bi coefficients are given in μm², μm^4, μm^6, etc. :
Sellmeier : the spectrum is defined by the following equation, where the Bi coefficients don't have a dimension and the Ci coefficients are given in μm² :
Procedural :
Band Stop : the spectrum returns a given value outside the pass range and returns 0 inside the pass range,
Short Pass : the spectrum returns a given value bellow the range end and returns 0 above,
Long Pass : the spectrum returns a given value above the range start and returns 0 bellow,
Gaussian Pass : the spectrum is a Gaussian curve with the given parameters,
Gaussian Stop : the spectrum returns a given value minus a Gaussian curve with the given parameters,
Raw : the spectrum is given manually, value per value. Between the given values, the spectrum can have different shapes :
Closest : the spectrum returns the value of the closest point,
Linear : the spectrum returns the linear interpolation between the two closest points,
Quadratic : between each two points a tangent point defines the tangent of the curve on both sides. The spectrum is made of quadratic polygonal segments going through each point and following the required tangents,
Cubic : for each point two tangent points define the tangent of the curve on each side. The spectrum is made of cubic polygonal segments going through each point and following the required tangents. If the "C1 continuity" toggle is enabled (toggle bellow the curve), the tangents of a point are linked to be aligned and the resulting curve has continuous derivatives.
See section bellow on how to edit the points.
Editing the spectrum
Spectrums of type "Raw" can be edited directly in the spectrum curve view.
A raw spectrum is defined by a list of control points : these points are represented in the view by squares. Control points can be :
selected by clicking on them,
moved by dragging them,
deleted by selecting them and hitting the "Delete" key,
added by double clicking on the view.
When tangent points are required, they are represented by dots in the view and linked to their associated control points by dotted lines. Tangent points can only be moved, they cannot be selected or added.
When dragging points, the position of the point on the wavelength (horizontal) axis will be limited between the two adjacent points : points need to be ordered in ascending order along the wavelength axis.
As a reminder, the "Info" button above the curve reveals details on how to navigate inside the spectrum preview.
Any kind of spectrum can be converted to a raw, editable spectrum using the conversion button in the spectrum inspector. The possible conversions are :
Conversion to Raw : the raw spectrum datas are listed and editable (figure B, bellow). When converting a measured or preset spectrum, all the datas contained in the measure file are listed. When converting a procedural spectrum (RGB, Blackbody, Cauchy, ...), one point every nanometer are listed.
Conversion to simplified Raw : the raw spectrum datas are simplified to reduce the number of editable points. In order to do so, points that can be deleted without affecting the curvature of the curve are removed. This procedure induces some error that can be limited to either 1% (figure C, bellow) or 5% (figure D, bellow) : the more error you accept, the less points there will be in the simplified curve.
Figure A - Original curve : procedural RGB color
Figure B - Raw curve : 199 points
Figure C - Simplified curve (1%) : 33 points
Figure D - Simplified curve (5%) : 24 points
Navigating inside the spectrum preview
When hovering over the spectrum curve in the spectrum inspector, a vertical line highlights the value of the spectrum at the given wavelength. The value is displayed on the top line of the graph using the following format : (wavelength, value).
You can zoom on a specific zone of the spectrum curve by click-and-dragging to select a rectangle on the curve.
You can also zoom in and out using the mouse scroll wheel.
When the curve is not entirely displayed on screen, a "Reset" button is available bellow the curve to reset to the original scale.
When the "Log Scale" toggle bellow the curve is enabled, the curve is displayed using a log scale. In that case, the grid behind the curve represent the tenths percentages of the maximum value.
Spectral Images in the Predict Suite
In the Predict Suite, spectral images are required to define some lights intensity and polarization :
Area lights' measured polarization,
Radiometric area lights' intensity,
Skyboxes' intensity,
Skyboxes' polarization.
A spectral image is defined with a texture in the OpenEXR format.
EXR files are image files with arbitrary depth where each depth component is called a layer and identified with a string label. Usual labels are the "R", "G", "B" ones used for color images. For spectral images, the Predictive Suite only recognizes layers with labels in the form "<wavelength>.L" with the wavelength in nanometer, for instance "550.35.L".
The intensity of radiometric area lights and skyboxes can also be defined with an RGB image that is converted to a spectral image by Predictive Engine. In this case, a spectral range and a number of channels can be specified to parameterize the conversion process.