genBSDF(1) generate BSDF description from Radiance or MGF input


genBSDF [ -c Nsamp ][ -n Nproc ][ -r 'rtcontrib opts...' ][ -t{3|4} Nlog2 ][ {+|-}forward ][ {+|-}backward ][ {+|-}mgf ][ {+|-}geom unit ][ -dim Xmin Xmax Ymin Ymax Zmin Zmax ] [ geom .. ]


GenBSDF computes a bidirectional scattering distribution function from a Radiance or MGF scene description given on the input. The program assumes the input is in Radiance format unless the +mgf option is specified. The output conforms to the LBNL Window 6 XML standard for BSDF data, and will include an MGF representation of the input geometry if the +geom option is given, followed by one of "meter," "foot," "inch," "centimeter," or "millimeter," depending on the scene units. The default is to include the provided geometry, which is assumed to be in meters. Geometry output can be supressed with the -geom option, which must also be followed by one of the above length units.

Normally, genBSDF computes components needed by a backwards ray-tracing process, +backward. If both forward and backward (front and back) distributions are needed, the +forward option may be given. To turn off backward components, use the -backward option. Computing both components takes about twice as long as one component.

The geometry must fit a rectangular profile, whose width is along the X-axis, height is in the Y-axis, and depth is in the Z-axis. The positive Z-axis points into the room, and the input geometry should not extend into the room. (I.e., it should not contain any positive Z values, since the putative emitting surface is assumed to lie at Z=0.)  The entire window system should be modeled, including sills and edge geometry anticipated in the final installation, otherwise accuracy will be impaired. Similarly, materials in the description should be carefully measured.

Normally, the input geometry will be positioned according to its actual bounding box, but this may be overridden with the -dim option. Use this in cases where the fenestration system is designed to fit a smaller (or larger) opening or is offset somehow.

The variance in the results may be reduced by increasing the number of samples per incident direction using the -c option. This value defaults to 2000 samples distributed over the incoming plane for each of the 145 Klems hemisphere directions.

In some cases, the processing time may be reduced by the -n option, which specifies the number of simultaneous rtrace(1) processes to run in rtcontrib(1). The -r option may be used to specify a set of quoted arguments to be included on the rtcontrib command line.

The -t4 mode computes a non-uniform BSDF represented as a rank 4 tensor tree, suitable for use in the Radiance rendering tools. The parameter given to this option is the log to the base 2 of the sampling resolution in each dimension, and must be an integer. The -c setting should be adjusted so that an appropriate number of samples lands in each region. A -t4 parameter of 5 corresponds to 32x32 or 1024 output regions, so a -c setting of 10240 would provide 10 samples per region on average. Increasing the resolution to 6 corresponds to 64x64 or 4096 regions, so the -c setting would need to be increased by a factor of 4 to provide the same accuracy in each region.

The -t3 mode is similar to -t4 but computes a rank 3 tensor tree rather than rank 4. This provides a much faster computation, but only works in special circumstances. Specifically, do NOT use this option if the system is not in fact isotropic. I.e., only use -t3 when you are certain that the system has a high degree of radial symmetry. Again, the parameter to this option sets the maximum resolution as a power of 2 in each dimension, but in this case there is one less dimension being sampled.


To create a BSDF description including geometry from a set of venetian blinds:
genblinds blind_white blind1 .07 3 1.5 30 40 | xform -rz -90 -rx 90 > blind1.rad
genBSDF -r @rtc.opt blind_white.mat glazing.rad blind1.rad > blind1.xml

To create a non-uniform, anisotropic BSDF distribution with a maximum resolution of 128x128 from the same description:

genBSDF -r @rtc.opt -t4 7 -c 160000 blind_white.mat glazing.rad blind1.rad > blind12.xml


The variable resolution (tensor tree) BSDF representation is not supported by all software and applicatons, and should be used with caution. It provides practical, high-resolution data for use in the Radiance rendering programs, but does not work in the matrix formulation of the daylight coefficient method for example. Also, third party tools generally expect or require a fixed number of sample directions using the Klems directions or similar.


Greg Ward