RenderToolbox BatchRender Parameter Files
Non-geometric scene properties such as object reflectance, spectral power distributions for lights and rendering parameters are supplied to BatchRender for scenes through three text files--conditions.txt, objectProperties.txt and lightProperties.txt. Furthermore, for the radiance rendering path, a fourth file, rendererParams.txt specifies additional rendering parameters. All files are tab-delimited tables in which the first line specifies field names and subsequent lines specify field values. Field names must not contain spaces, though field names can.
Each line of field values in conditions.txt refers to one rendering of the scene to be carried out by BatchRender--that is, for each line, BatchRender will generate one set of hyperspectral, monitor and cone image files. Each line in objectProperties.txt and lightProperties.txt refer to one object or light. rendererParams.txt may only have one line of field values, specifying the rendering properties for all of the conditions to be rendered in the radiance rendering path. Any value in objectProperties.txt, lightProperties.txt or rendererParams.txt may be set to change for each condition to be rendered. For example, you can set the surface reflectance spectrum of an object (it's color) to change during each rendering. In order to set a property to be condition dependent, it is linked from objectProperties.txt, lightProperties.txt or rendererParams.txt to conditions.txt by placing an expression of the form 'c_[field_name]' in the properties file and the field 'field_name' in conditions.txt. The value of that on each line of conditions.txt will then replace '[c_field_name]' for each rendering. The following (simplified) example illustrates this case:
conditions.txt:
conditionName surfaceColor con1 1 con2 2
objectProperties.txt:
objectName spectrumNumber spectrumType mysquare c_surfaceColor macbethPeter mycircle c_surfaceColor macbethPeter
Here, mysquare and mycircle will both be rendered in the first macbethPeter color (see below for description of spectrumNumber and spectrumType) in the first condition, called con1, and in the second macbethPeter color in the second condition, called con2.
The conditions.txt file
Minimal example file contents, leaving most properties to default values:sceneName renderer imageRes pbrt_condition pbrt 200 rad_condition radiance 200
Example of file contents including most fields, not no fields linked from other parameter files:
sceneName fileName renderer imageRes wavelengthsStart wavelengthsStep wavelengthsNumSteps viewFile humanCones tonemap calibrationFile d65_rad scene_objects radiance 100 400 10 31 view.vf ss2 1 srgb ramplgt_rad scene_objects radiance 100 400 10 31 view.vf ss2 1 srgb rampsur_rad scene_objects radiance 100 400 10 31 view.vf ss2 1 srgb
Required Properties
- sceneName: refers to name with which output files will be prefixed. Each sceneName must be unique. No default value.
- renderer: the rendering path through which the current condition will be rendered. Must be either pbrt, pbrt_orig, radiance or radiance_direct. No default value.
- imageRes,imageResX/imageResY: specifies the final resolution of the rendered image. Either imageRes or both of imageResX and imageResY must be present. imageRes specifies a square image, while imageResX and imageResY specify the width and height of a rectangular image. Only required for radiance rendering, for which there is no default. For pbrt, pbrt_orig and radiance_direct, default values are those stored in the .pbrt or .rif files in the experiment directory. Values in conditions.txt, however, will override the values stored in these the .pbrt or .rif files.
- viewFile: Specifies a the .vf file, located in the 'view_files' directory, containing camera information for radiance rendering. BatchRender will look for [viewFile], so you include the .vf suffix in the field value. Required only for radiance rendering, no default. Ignored for other rendering paths.
- fileName
- radiance: refers to the name of the directory in which BatchRender will look for the .obj object and .rad light files that define the geometry of the scene. Giving this field the same value for different conditions allows each condition to draw from the same directory of objects and lights. Changing this value allows for the same scene to be rendered with different geometries. Each scene objects directory must have, however, .obj and .rad files of same name, because each condition draws from the same objectProperties.txt and lightProperties.txt files. The default value for fileName in radiance rendering is 'scene_objects'.
- radiance_direct: specifies the name of the .rad and .rif file that BatchRender will look for for this condition, located at the root of the experiment directoy. Adding the .rad and .rif suffixes to the fieldvalues in conditions.txt is optional. Default is the value of sceneName.
- pbrt: specifies the pbrt file to use for each condition. The '.pbrt. suffix may be optionally added to the field value. As in for radiance rendering, using one value for every condition causes BatchRender to draw from the same .pbrt file for each condition. Change it in order to use different .pbrt files for different conditions. Each .pbrt file, however, must have the same objects and lights. Default is the value of sceneName.
- pbrt_orig:same as for pbrt.
- wavelengthStart: the first wavelength, in nanometers, of hyperspectral sampling. Default is 400.
- wavelengthStep: the number of nanometers between each step in the sampling. Default is 10.
- wavelengthNumSteps: the total number of steps in the sampling. Default is 31.
- humanCones: PsychToolbox file used to model human cone receptivity. Defult is 'ss2'
- tonemape: 1 or 0. whether or not to tonemap the final rendered image. Default is 1 (true)
- calibrationFile: PsychToolbox file used to calibrate monitor images. Defult is 'srgb'
- illumGain:multiplies all lights in the scene by a constant. Default is 1.
The objectProperties.txt file
Example file contents:objectName objectType glossiness roughness spectrumNumber spectrumType backwall ward 0 0 24 macbethPeter floor ward 0 0 13 macbethPeter room ward 0 0 20 macbethPeter table ward 0 0 19 macbethPeter sphere ward 0 0 c_sphereColor macbethPeter
Required Fields
- objectName
- radiance: refers to an object in the scene_objects folder of the name [objectName].obj.
- radiance_direct: refers to an object in the .rad file for the current condition. Must be tagged according to link.
- pbrt,pbrt_original: refers to an object in the pbrt file for this condition. Objects must be tagged according to link.
Optional Fields
- objectType: Must be 'ward' for all rendering paths. Default is 'ward'.
- glossiness and roughness: Specify the glossiness and roughness parameters for a ward object. Default is 0 for both.
- spectrumNumber: the spectrum within the sur .mat file specified in spectrumType. If no spectrumNumber is specified but a spectrumType is specified, the default spectrumNumber is 1. If neither the spectrumNumber or the spectrumType is specified, the default is spectrumNumber 24 in spectrumType macbethPeter.
- spectrumType: BatchRender will look a file called sur_[spectrumType].mat in to find the the SRF for this object. The "sur_" prefix and ".mat" suffix are unnecessary but may be included in this fieldvalue. BatchRender looks first in the experiment directory of the current scene, then the RenderDataFiles directory of RenderToolbox_2.0 and then in the rest of the Matlab path. Files must be formatted as SRF .mat files as they are for the PsychToolbox. If no spectrumType is specified, the default is macbethPeter.
The lightProperties.txt file
Example file contents:lightName spectrumType lightType spotlight_light D65 point
Required Field
- lightName
- radiance: refers to a light in the scene_objects folder of the name [objectName].rad.
- radiance_direct: refers to a light in the .rad file for the current condition. Must be tagged according to link
- pbrt,pbrt_original: refers to a light in the pbrt file for this condition. Lights must be tagged according to link
- lightType: only has an effect on lights in the radiance rendering path. Can be either point, spot, or area. Must match the light type stored in the light's .rad file in the scene_objects directory.
- spectrumNumber: Lights use the same system for SPDs as objects do for SRFs. spectrumNumber thus refers to a SPD stored in PsychToolbox spd .mat file. Default is 1.
- spectrumType: BatchRender looks for spd_[spectrumType].mat, first in the experiment directory, then in the RenderToolbox_2.0/RenderDataFiles directory and then on the rest of the path. As in for objects, is doesn't matter whether you include the 'spd_' or '.mat' in the field value. Default is D65 (daylight spectrum).
The rendererParams.txt file
Only required if 1 or more conditions are to be rendered in radiance, and applies only to those conditions. There are two ways of specifying parameters to Radiance through BatchRender: either by specifying each option used in Radiance RIF files, or by manually specifying the parameters to the Radiance binaries oconv and rpict. The first field, renderParamsType in rendererParams.txt specifies which of these two methods you are using, either rifFile or manual. If this field is omitted, BatchRender assumes that you are using the rifFile method.The rifFile method
Each of these fields corresponds to fields in the .rif files used by radiance to render the images, except renderParamsType, described above, and ambientLightSpectrumType, ambientLightSpectrumNumber and ambientLightIllumGain, described below. See radiance documentation for information on the other parameters. The ambientLight parameters govern the -av render option, and so leave this option out of the render field value.Example file contents, leaving ambientLight parameters to their defaults:
renderParamsType zone exposure z quality penumbras indirect detail variability report render rifFile Interior 0 40.1 0 25.5 0 19.4 1 Z Medium True 0 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
Required Fields
- zone
- exposure
- z
- quality
- penumbras
- indirect
- detail
- variability
- report
- render
Optional fields
- ambientLightSpectrumType/ambientLightSpectrumNumber: adds an ambient light to the scene in the form of the .rif file's render option -av. ambientLightSpectrumType/Number work the same way as other lights' spectrumType and spectrumNumber, using the same SPD files and searching for them in the same order. Default is D65 light.
- ambientLightIllumGain:multiplies the ambient light spectrum by a fixed constant. Default is 1.
The manual method
After the renderParamsType field, this file contains the fields oconv and rpict, in which you specify the command line arguments to these Radiance programs. You do not need to specify files names, as BatchRender will add them automatically to the command line call to oconv and rpict. Here's an example:renderParamsType oconv rpict manual -w -t 5 -vf view_files/center.vf -ab 3 -x 512 -y 512
From these arguments, BatchRender might use the following calls to Radiance:
oconv -w your_materials.rad your_objects.rad your_lights.rad > this_condition.oct rpict -t 5 -vf view_files/center.vf -ab 3 -x 512 -y 512 this_condition.oct>this_condition.pic
Here, BatchRender has supplied "your_materials.rad your_objects.rad your_lights.rad > this_condition.oct" for the call to oconv and "this_condition.oct>this_condition.pic" for the call to rpict for each wavelength of each condition.
Note that the view file you specify will override the viewFile field in conditions.txt. The same is true for -x and -y resolution. Also, if you would like to specify no arguments to oconv or rpict, just insert a space in their place.
There are 3 comments on this page. [Display comments]