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”:

1
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 “tregenza.cal” (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 tregenza.cal tbin
0
0

Treg_dist glow skyglow
0
0
4 1 1 1 0

skyglow source sky
0
0
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 “reinhart.cal” 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.

Best,
-Greg

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 “klems_full.cal” 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.

Cheers,
-Greg

Thank you, Greg! I got it!

2 Likes

Hi, Greg,

According to your answer, I can use reinhart.cal to generate different number of sky patches, but the problem is how can I set the MF value in my Radiance scene description:

For example, below is my Radiance scene file, but I don’t know how to specify the value of MF in it.

void brightdata Rehinart_dist
4 noop sky.dat reinhart.cal rbin
0
0

Rehinart_dist glow skyglow
0
0
4 1 1 1 0

skyglow source sky
0
0
4 0 0 1 360

You probably need to copy “reinhart.cal” to some new file, like “myReinhart.cal” and add the appropriate definition (e.g., “MF:4;”) near the top of the file.

Cheers,
-Greg

1 Like

Thank you! Greg! I have copied the reinhart.cal to Myreinhart.cal and revised the MF into A1, then I can specify this value in the Radiance scene file.

void brightdata Rehinart_dist
4 noop sky.dat Myreinhart.cal rbin
0
1 1

Rehinart_dist glow skyglow
0
0
4 1 1 1 0

skyglow source sky
0
0
4 0 0 1 360