Utah sky model .cal file

All this talk of Radiance skies made me remember that I recently implemented part of Preetham, Shirley, Smits, "A Practical, Analytical Model for Daylight" for Radiance. It's rough around the edges, but produces good (if not totally accurate) results.

Specifically, I modeled the part that determines the sky color and brightness, not the part that determines the color shift for faraway objects due to atmospheric scattering (maybe I'll have that done by the Radiance User Conference this year).

To use it, first run gensky (as normal), but comment out the brightfunc description and add a new colorfunc entry. The real arguments are turbidity and sun direction (copy the last 3 entries from the brightfunc line), like this example for a sky after sunset:

#void brightfunc skyfunc
#2 skybr skybright.cal
#7 1 9.75e-01 4.02e-01 2.68e-01 -0.918161 0.378882 -0.115887

void colorfunc skyfunc
4 skyr skyg skyb utah.cal
4 2. -0.918161 0.378882 -0.115887

Like gensky, to use it attach it to a glow source:

skyfunc glow skydome
0 0 4 1. 1. 1. 0
skydome source sky
0 0 4 0 0 1 180
skydome source sky2
0 0 4 0 0 -1 180

So, for the sample scene file attached, run:

% oconv duskscene.rad > duskscene.oct
% rvu -vp 1 -5 2 -vd -1 5 -1.5 -vh 90 -vv 90 -ab 2 -ad 512 -ar 512 -as 128 -aa 0.1 -pe -5 duskscene.oct

It isn't quite automatic yet, and it does emit some errors, though I hope to clean those up soon.

Would this be most useful as a command-line option to gensky? It would seem most applicable there. Plus, that would allow control over the sun color, which shifts subtly from white to orange-ish nearer the horizons.


[email protected]

duskscene.rad (656 Bytes)

utah.cal (3.55 KB)