-
Notifications
You must be signed in to change notification settings - Fork 2
RGBPromotion
The RGBPromotion recipe exposes the algorithms that renderers use to "promote" RGB reflectances to internal spectral representations, and checks the promoted spectra for sanity.
The RGBPromotion recipe is based on the PromoteRGBReflectance()
utility, which renders a matte reflector with a given RGB reflectance, under an arbitrary illuminant. The PromoteRGBReflectance()
utility is located here:
(path-to-RenderToolbox3)/Utilities/SpectralPromotion/PromoteRGBReflectance.m
PromoteRGBReflectance()
is based on a simple parent scene. A camera views a square matte reflector, such that the camera's viewing axis coincides with the normal vector at the center of the reflector. The reflector uses an arbitrary RGB reflectance provided by the user. The scene is illuminated with a "sun" light aligned so that all of the illuminating rays are parallel with the camera's viewing axis. The "sun" uses an arbitrary spectrum provided by the user.
PromoteRGBReflectance()
allows a renderer to render the simple scene, and obtains a multi-spectral output image. It reads the output spectrum from a pixel that corresponds to the center of the matte reflector. This output spectrum depends on several quantities including:
- the RGB reflectance that the user provided
- the illuminant spectrum that the user provided
- the algorithm that the renderer used to "promote" the RGB reflectance to its internal spectral representation
PromoteRGBReflectance()
estimates the "promoted" reflectance spectrum that the renderer used internally by taking an output pixel spectrum, dividing out the illuminant spectrum, and dividing out a scene-specific constant that is related to the scene geometry. It returns this "promoted" spectrum. It also returns a new RGB reflectance, based on the "promoted" spectrum, for direct comparison with the original RGB reflectance that the user provided. The RGB down-conversion is based on CIE XYZ 1931 color matching functions via the sRGB standard.
The RGB Promotion recipe invokes PromoteRGBReflectance()
several times, with different RGB reflectances and illuminant spectra. It plots the original RGB reflectances for visual comparison with the "promoted" spectra, and with the down-converted RGB reflectances based on CIE XYZ 1931. It superimposes results from PBRT and Mitsuba.
Generally, by visual comparison:
- the "promoted" spectra from PBRT and Mitsuba are quite similar
- the "promoted" spectra depend on the illuminant weakly or not at all
- the "promoted" spectra seem to scale linearly with initial RGB values (compare 1, 1, 1 with 1/2, 1/2, 1/2 below), so the renderers probably are not performing any gamma correction on the RGB values as part of the promotion.
- the sum of "red", "green" and "blue" promoted spectra is approximately but not exactly equal to the a "white" promoted spectrum, so the renderers seem to be promoting RGB values to spectral representations in a fashion that is not exactly linear.
- the down-converted RGB reflectances based on CIE XYZ 1931/sRGB are not the same as the original RGB reflectances.
There isn't any a priori reason why the down-converted RGB reflectances should match RGB specified for promotion, we were just interested in the comparison. Indeed, we expect that the main application of understanding the promotion algorithm is to be able to produce full reflectance spectra that can be used elsewhere in a scene that employs RGB texture mapping, and that will match the texture mapped surfaces in reflectance. Thus, PromoteRGBReflectance()
makes it easy to expose the promotion that the renderers perform.
The executive script MakeRGBPromotionFigure.m
produces a summary of RGB promotion results. It is located here:
(path-to-RenderToolbox3)/ExampleScenes/RGBPromotion/MakeRGBPromotionFigure.m
Each row contains results for a different condition, with a different initial RGB value:
- the "irregular" RGB has all different red, green, and blue components, and none zero or saturated.
- the "red" RGB has only saturated red.
- the "green" RGB has only saturated green.
- the "blue" RGB has only saturated blue.
- the "white" RGB has all components saturated.
- the "sum" condition shows the sum of results from the "red" "green", and "blue" conditions.
- the "gray" condition has all components at half maximum.
Plots in the two left-hand columns show results obtained using the a CIE daylight illuminant spectrum correlated to 4000K (labeled "CIE-day-4000"). Plots in the two right-hand columns show results obtained using the a CIE daylight illuminant spectrum correlated to 10000K (labeled "CIE-day-10000").
Plots come in pairs. Within each pair, the left plot shows RGB reflectances, with "R" (red), "G" (green), and "B" (blue) components separated. Components for original RGB reflectances use "X" and "O" markers for Mitsuba and PBRT, respectively. Since the original RGB reflectances are the same for both renderers, the "X" markers always fill in the "O" markers.
Components for down-converted RGB reflectances based on CIE XYZ 1931 matching functions use "+" and "[]" markers for Mitsuba and PBRT, respectively. These components may differ from the original RGB components. Nevertheless, Mitsuba and PBRT generally agree, so the "+" markers generally fill in the "[]" markers.
Within each pair of plots, the right plot shows "promoted" spectra, which are defined for wavelengths in the range 400-700nm. Components for "promoted" spectra use "X" and "O" markers for Mitsuba and PBRT, respectively. Mitsuba and PBRT generally agree, so the "X" markers generally fill in the "O" markers. The promoted spectra generally have the same shape as the original RGB reflectances.