1
RenderToolbox
A MATLAB Toolkit forHyperspectral Rendering with
Radiance and PBRT
Daniel P. Lichtman, Bei Xiao, David H. Brainard
AcknowledgementsRenderToolbox
•Bei Xiao•Professor David H. Brainard•Robyn Oliver
2
• To produce stimuli for psychophysicalexperiments which are accurately derivedfrom the physical properties of lights andsurfaces.
• We are “consumers” of renderers, so wewould like to better understand theirperformance.
• To produce these stimuli without the userneeding to be an expert in Radiance/PBRTor even MATLAB.
GoalsRenderToolbox
Design
• RenderToolbox acts as a wrapper aroundextant renderers, enabling them to renderhyperspectrally. This provides coloraccuracy, which is important in our lab.
• The toolbox is designed to allow easycomparison of the variations betweenrenderers.
RenderToolbox
3
Radiance and PBRTBoth renderers have 2 important features:
•They are designed to simulate the physicalflow of light through scenes
•They are freely and publicly available.
RenderToolbox
Ease of Use• Model scene geometry and preview
rendered images in Maya (but don’trender in Maya).
• Simple text-file based interface forattaching surface reflectance functionsto objects and spectral powerdistributions to illuminants.
• Transparent interchange betweenRadiance and PBRT.
• Wrapper software written in MATLAB,which is easily maintained and modified.
RenderToolbox
Model geometry inMaya
Associate objectswith BRDFs andlights with SPDs
Render inRadiance and
PBRT
Convert image toLMS or RGBcoordinates
4
RenderToolbox
• Maya is a commercial program that lets youdesign 3D scenes.
• A plugin allows you to export objects intoRadiance .obj format.
• A modified public domain plugin allows you toexport objects into PBRT format.
Software: Geometry in MayaModel geometry in
Maya
Associate objectswith BRDFs andlights with SPDs
Render inRadiance and
PBRT
Convert image toLMS or RGBcoordinates
RenderToolbox
Software: Geometry in MayaModel geometry in
Maya
Associate objectswith BRDFs andlights with SPDs
Render inRadiance and
PBRT
Convert image toLMS or RGBcoordinates
Output from Maya to Radiance and PBRT
Radiance format PBRT format
plugin plugin
(Also support native .rad and .pbrt format)
5
RenderToolbox
Software: Hyperspectral BRDFs & SPDsModel geometry in
Maya
Associate objectswith BRDFs andlights with SPDs
Render inRadiance and
PBRT
Convert image toLMS or RGBcoordinates
Each object gets a BRDF•The BRDF is specified in a text file
•The BRDF may have multipleparameters, and each may bespecified at every wavelength
Each illuminant gets anSpectral PowerDistribution•This is also specified in a text file
•The illuminant’s power can bespecified at each wavelength
RenderToolbox
Software: BRDF exampleModel geometry in
Maya
Associate objectswith BRDFs andlights with SPDs
Render inRadiance and
PBRT
Convert image toLMS or RGBcoordinates
Ward reflectance model specified in aseparate text file•Diffuse Reflectance specified at each wavelength•Specular Reflectance specified with one number•Roughness specified with one number
6
RenderToolbox
Software: SPD exampleModel geometry in
Maya
Associate objectswith BRDFs andlights with SPDs
Render inRadiance and
PBRT
Convert image toLMS or RGBcoordinates
Daylight illuminant spectrum specifiedin a text file•Power is specified at each wavelength inWatts/ Steradian
RenderToolbox
Software: RenderingModel geometry in
Maya
Associate objectswith BRDFs andlights with SPDs
Render inRadiance and
PBRT
Convert image toLMS or RGBcoordinates
Geometry from Maya, and object BRDFsand illuminant SPDs passed to both thePBRT and Radiance renderers.
Geometry BRDF/SPD
Radiance Rendering
PBRT Rendering
7
RenderToolbox
Software: RenderingModel geometry in
Maya
Associate objectswith BRDFs andlights with SPDs
Render inRadiance and
PBRT
Convert image toLMS or RGBcoordinates
Radiance and PBRT each rendermonochromatic versions of the scene ateach wavelength
Radiance
400nm
600nm
500nm
700nm
RenderToolbox
Software: LMS and RGB coordinatesModel geometry in
Maya
Associate objectswith BRDFs andlights with SPDs
Render inRadiance and
PBRT
Convert image toLMS or RGBcoordinates
Hyperspectral color data is useful, butwe’ve provided tools to convert the imageto an LMS cone image and a RGB monitorimage.
Cone image in LMS Monitor image in RGB
8
RenderToolbox
Software: Tonemapping and CalibrationModel geometry in
Maya
Associate objectswith BRDFs andlights with SPDs
Render inRadiance and
PBRT
Convert image toLMS or RGBcoordinates
The RGB monitor image can betonemapped and calibrated to a specificmonitor. It is easy to write your owntonemapping algorithm.
Tonemapped and calibrated image in RGB
RenderToolbox
Additional Features•The toolbox is configured to compute in a parallelcomputing environment, specific to our lab, but easilyadaptable.•Also configured to render multiple versions of thesame scene with different BRDFs and SPDs, as wellas different rendering properties.
•The package is written so that it’s easy to use forsomeone who’s not an expert in Radiance orMATLAB.•The toolbox is available as a beta version online athttp://www.rendertoolbox.org.•We’re still working on the documentation but we’rehappy to help you set it up.
9
RenderToolbox
Comparison of the two renderers•PBRT doesn’t natively support the ward model, butwe’ve included a ward shader for PBRT which wefound on the internet and modified.
•As this example of an arbitrary scene illustrates, thedifference between Radiance and PBRT’s output issmall. Comparing the two is simply a matter ofreplacing ‘radiance’ with ‘pbrt’ in a conditions file.
-
Radiance image PBRT image
=
Difference
RenderToolbox
Examples•RenderToolbox includes two examples thatdemonstrate its function and compare specificelements of Radiance and PBRT’s performance.•We choose to use simple scenes for which we couldcompute features of the rendered image from firstprinciples.
10
RenderToolbox
Example: Simple Square•This is the simplest scene possible.•This example demonstrates that the spectral featuresof the whole package works correctly and that wecorrectly wrote our software.
Surface Reflectance (blue)surface reflectance vs. wavelength (nm)
Illuminant (D65 Daylight)power (watts) vs. wavelength (nm)
Scene characteristics
RenderToolbox
Example: Simple Square
Radiance
PBRT
ResultsScaled luminance vs. wavelength (nm)
11
RenderToolbox
Example: Sphere with Point Light•This scene includes a sphere and distant pointlight in anorthogonal projection.•Computing the luminance for the sphere and pointlight with theward model is straightforward, so we generated an image of thesame configuration from first principles.
Radiance PBRT Analytic•The images are very similar. We attribute subtle differences ingeometry to changes that occur during the export from Maya.•We didn’t write a perspective projection, but the Radiance andPBRT images match each other very closely, which increases ourconfidence that they are both doing the right thing.
RenderToolbox
Example: Sphere with Point LightScaled Luminocity vs. Vertical Location Along Column
in Image
top bottom
Measure along a verticalslice of the sphere
12
RenderToolbox
•Plan to include another example to test therenderers’ performance with secondary bounces.
•RenderToolbox provides a simple interface toRadiance and PBRT, especially for use inpsychophysics.•Comparison of rendered images from the tworenderers for simple cases indicates good agreementand increases our confidence that these renderersare appropriate for use in generating experimentalstimuli.•Beta version available here:
http://www.rendertoolbox.org
Summary