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.
You must also place PBRT_batchRender/bin/pbrt on either the system path or on MATLAB’s binary search path, and the environment variable PBRT_SEARCHPATH must either be set by the system or within MATLAB to the location of a local copy of PBRT_batchRender/bin. A licensed copy of Maya is also required to design scenes.

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.
Once a scene has been defined in Maya and exported in either Radiance or PBRT format, store the .obj and .rad files in scene_objects within the scene directory, and the files rayinit.cal and tmesh.cal at the root of the scene directory as described above.

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:
(Note that the previous two object properties are specific parameters for the ward reflectance model. If a different reflectance model is introduced in the future, it might require its own parameters which would be inserted here.)
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:
    Here is an examples lightProperties.txt:
    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:

    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.

    There are 10 comments on this page. [Display comments]

    Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by WikkaWiki