How To Use
Introduction
BatchRender allows the user to render multiple conditions of the same scene using both the Radiance and PBRT renderers in a multi-processor computing environment. Each condition of a scene uses the same geometric scene description while modifying any one or more object, light or overall scene properties such as an object reflectance spectrum, object glossiness, light illumination spectrum or final image resolution.
Requirements
BatchRender requires RenderToolbox to be on MATLAB’s path. After downloading the current revision of RenderToolbox , run Render_AddToolboxPath in RenderToolbox_2.0/RenderToolboxPathHandling/Render_AddToolboxPath.m, passing to the function the full path to the location of a local copy of the RenderToolbox. A current version of the PsychToolbox must be on MATLAB’s path as well.
- describe how to download copies of these packages
Scene Definition: Introduction
BatchRender stores all of the files related to a single scene in a directory, generally of the same name as the scene. This includes either or both Radiance or PBRT files which define the geometry of the scene (depending on whether the scene is to be rendered with either one or both renderers), temporary files which are created during the rendering process and a set of final rendered images. These files are organized into a hierarchy of subdirectories. For scenes in which any of the conditions will be rendered in Radiance, object and light .obj and .rad files must be saved in a directory called scene_objects and viewfiles are saved in the view_files directory. The files rayinit.cal and tmesh.cal must also be saved at the root of the experiment directory (see Scene Definition in Maya below for a description of the files necessary for Radiance rendering). If any conditions are to be rendered with PBRT, the PBRT file must be saved at the root level of the scene directory with the name [condition name].pbrt (see the section on conditions below). Temporary files generated during the rendering process are stored in the tmp directory, created by BatchRender each time it is run. If a ‘tmp’ directory already exists in the scene directory at run time it is erased and replaced with a new one. Final rendered images are stored in several different directories within the scene directory that are created by BatchRender which include image_data, monitor_image_data and cone_image_data. See the Final Rendered Images section for more details.
Scene Definition in Maya
Scene geometry is first designed in Maya, including all object and light shapes and positions, but not including material and reflectance properties for object, or illumination spectrums for lights. All objects must be defined as polygons, and all lights must be either point lights or spot lights.
- standardize the procedure for exporting scenes in either radiance or pbrt format
Defining non-geometric scene qualities
In BatchRender, all of the non-geometric object qualities such as object reflectance spectra and light illuminance spectra, as well as general scene characteristics such as resolution and view point are enumerated in a series of text files: conditions.txt, lightProperties.txt, objectProperties.txt and rendererParams.txt. These files are formatted as tab delimited tables in which the first row is a list of column names and following rows form the data that populates the table.
Object properties are stored in the objectProperties.txt file. These include:
- objectName: which must correspond to a .obj file if the scene is to be rendered in Radiance or the name of the object in the PBRT file if the scene is to be rendered in PBRT
- objectType: specifies the reflectance model to be used for the object. ward is the only currently supported reflectance model
- glossiness: the glossiness parameter for the ward reflectance model
- roughness: the roughness parametere for the ward reflectance model
spectrumNumber: the identification number of the object’s diffuse reflectance spectrum
spectrumType: the database to which spectrumNumber refers. All objects currently use the macbethPeter database.
An example objectProperties.txt file is as follows (Note that extra tabs have been added to this and the following code segments in order to line up the columns. In order to use this specific code, these extra tabs must be removed)objectName objectType glossiness roughness spectrumNumber spectrumType backwall ward 0 0 24 macbethPeter floor ward 0 0 13 macbethPeter
Light properties are stored in lightProperties.txt. These properties include:
- lightName: must correspond to [lightName].rad for Radiance scenes and/or a light in the PBRT file for scenes rendered in PBRT.
- spectrumType: specifies the illuminant spectrum of the light. Currently only supports ‘D65’, a standard daylight spectrum.
- lightType: specifies the type of light such as a point light, spot light or area light. Only point lights are currently supported, indicated as ‘point’.
lightName spectrumType lightType pointlight1 D65 point
Render parameters are stored in rendererParams.txt. These parameters are passed directly to the ‘rad’ binary, which is part of the radiance rendering package. See the Radiance documentation for a description of these parameters.
rendererParams.txt sample:
zone exposure z quality penumbras indirect detail variability report render Interior 0 40.1 0 25.5 0 19.4 1 Z Medium True 2 Medium Medium 0.2 -dj 0.6 -dt 0.01 -dr 3 -ds 0.1 -sj 0.7 -st 0.15 -dc 0.5 -lr 1 -aw 0 -av 0.5 0.5 0.5
Conditions
The conditions.txt file contains general scene characteristics such as resolution and view. Each condition requires the following field:
- sceneName: the name of the condition. A sceneName must not be repeated more than once.
- renderer: either radiance or pbrt. If it is pbrt, there must be a PBRT file [sceneName].pbrt in which BatchRender will find the scene geometry.
- imageRes: image resolution in pixels. BatchRender always produces a square image of the specified length and width
- wavelengthsStart, wavelengthsStep and wavelengthsNumSteps: specify the frequency sampling to be used by BatchRender for this condition in nanometers. Start is the first sampled frequency, Step is the step size and NumSteps is the number of steps.
- viewFile: only necessary if the renderer for this condition is radiance. Specifies the view file generated when the scene was exported from Maya.
- humanCones: the .mat file specifying technical information about human cone sensitivities. Provided with the PsychToolbox.
- tonemape: either 1 or 0, specifies whether or not BatchRender will tone map the final rendered image.
- calibrationFile: (??)
- lightPower: (??)
Here is an example of a conditions.txt file with these properties for two conditions:
sceneName renderer imageRes wavelengthsStart wavelengthsStep wavelengthsNumSteps viewFile humanCones tonemap calibrationFile lightPower con_pbrt_left pbrt 400 400 1 1 view_file ss2 1 StereoLeft_8 7 con_pbrt_right pbrt 400 400 1 1 view_file ss2 1 StereoRight_8 7
Each condition can also contain information about object and light properties that change for each rendering, such as the reflectance spectrum of a particular object. In this case, the relevant entry in objectProperties.txt or lightProperties.txt is modified so as to indicate that its value will depend upon the current condition. In order to specify conditional dependency, replace the value in the table with ‘c_’ followed by a field name in the form of ‘c_[field name]. BatchRender then looks for a column in conditions.txt of the heading [field name], and replaces the object of light quality value in objectProperties.txt or lightProperties.txt with that value.
If we want to create a scene in which the reflection spectrums of both floor and backwall change with each condition, we could change the objectProperties.txt segment from above to the following,
objectName objectType glossiness roughness spectrumNumber spectrumType backwall ward 0 0 c_backwallSpectrumNumber macbethPeter floor ward 0 0 c_floorSpectrumNumber macbethPeter
and add two columns to the conditions.txt (in this case the wall and the floor switch colors):
sceneName renderer imageRes wavelengthsStart wavelengthsStep wavelengthsNumSteps viewFile humanCones tonemap calibrationFile lightPower backwallSpectrumNumber floorSpectrumNumber con_pbrt pbrt 400 400 1 1 view_file ss2 1 StereoLeft_8 7 24 13 con_pbrt_right pbrt 400 400 1 1 view_file ss2 1 StereoRight_8 7 13 24
Final Rendered Images
BatchRender divides the output of the rendering process into three directories, image_data, cone_image_data, and monitor_image_data. Monitor imagesAll images are stored in a matlab .mat file readable by the PsychToolbox except monitor images, which are also stored as JPEGs. image_data contains a final black and white image for each wavelength sample of each condition. monitor_image_data contains a final RGB monitor image for each condition that can be displayed with the PsychToolbox.
- have to add about cone_image_data and filename format and how to actually display the final images with rendertoolbox.--> does this require a section on how to use the rendertoolbox? Rendertoolbox is somewhat useable outside of the context of batchrender, but difficult to use.
There are 10 comments on this page. [Display comments]