Is there any way to obtain the scene files of Tregenza sky patches?

We can use the rcontrib to get the HDR image of Tregenza sky patches. But is there any way to obtain the scene files of Tregenza sky patches (rad files)? I want to put the Tregenza sky patches into the scene file, so that they can be rendered using rpict.

If you want the sky to correspond to a particular distribution, you can do the following:

gensky {month day time} -s | genskyvec -h -m 1 | rcalc -e '$1=$1*.265+$2*.67+$3*.065' > sky.dat

This creates a set of uncolored patch radiance values for your Tregenza sky. You will then need to add the following lines to the top of the ascii file created above, which I’ve named “sky.dat”:

0 145 146

This says you have 1-dimensional data going from 0 to 145 (in steps of 1.0), which are your Tregenza sky patches. Then, you use the supplied file “” (this should be installed already but may be found in ray/src/cal/cal) to index these patch values in your Radiance scene description:

void brightdata Treg_dist
4 noop sky.dat tbin

Treg_dist glow skyglow
4 1 1 1 0

skyglow source sky
4 0 0 1 360

If you then wish to include the solar orb in your model, you can take the output of the same gensky command with “+s” instead of “-s” and add it to your model.

There is also a “” file that you can use with genskyvect -m N to get a set of Reinhart sky patches, modifying the above procedure for the different number of patches.


Thank you, Greg! I have got the sky patches following your guide. However, I want to ask another question that is if there is a way to generate klems patches for a glazing (panel), just like what is done in the three phase method.

For that, rfluxmtx or rcontrib are a bit easier to use, but you can apply a similar trick using the “” file found in ray/src/util and installed in the standard Radiance library folder on your system.

Instead of tbin, you can use one of the defined window orientations “kbinN, kbinE, kbinS, kbinW, or kbinD” for north, east, south, west, and skyward. You will need to supply 145 (rather than 146) data values, going from 0 to 144 rather than 145. You can use rfluxmtx to compute the values for this data array, or just make up random colors if you only want to visualize the patches.


Thank you, Greg! I got it!