# Radiance skies: patch vs smooth

I noticed a difference in the sky brightness near the horizon depending on whether I use a sky subdivision or not. I expected that the brightness of each sky patch in the Reinhart subdivision would be the average brightness of the Perez sky in that region. What I’m finding is that this is mostly true, but not near the horizon. I wonder if someone can explain.

Here’s an example of what I’m looking at. The method here was to render the sky dome in a 180-degree fisheye view using gendaylit/rpict and then gendaymtx/vwrays/rcontrib/dctimestep, and then compare the difference images.

Here’s the gendaymtx sky minus the gendaylit sky:

And here’s the gendaylit sky minus the gendaymtx sky:

As you can see, pretty much every patch is half brighter and half darker in the gendaymtx sky compared to the gendaylit sky, which makes sense. The problem is the ring of patches closest to the horizon, which are uniformly brighter in the gendaymtx sky than in the gendaylit sky. The biggest difference I’ve seen (not including the four patches closest to the sun) is over 10,000 cd/m^2.

For the record, here’s how I’m generating the gendaylit sky:

gendaylit 1 18 9.5 -W 689 60 -a 44.88 -o 93.23 -m 90 1>sky_1_18_9.5.rad
echo skyfunc glow sky_mat 0 0 4 1 1 1 0 1>>sky_1_18_9.5.rad
echo sky_mat source sky 0 0 4 0 0 1 180 1>>sky_1_18_9.5.rad
rpict -vta -vh 180 -vv 180 -vp 0 0 0 -vd 0 0 1 -vu 0 1 0 sky_1_18_9.5.oct 1>sky_1_18_9.5.hdr

And here’s how I’m generating the gendaymtx sky:

gendaymtx -m 1 -c 1 1 1 -of USA_MN_Minneapolis-St.Paul.wea > sky.smx
echo rvu -vta -vp 0 0 0 -vd 0 0 1 -vu 0 1 0 -vv 180 -vh 180 -vo 0 -va 0 -vs 0 -vl 0 > up.vf
vwrays -vf up.vf -x 512 -y 512 -d > view.txt
vwrays -ff -vf up.vf -x 512 -y 512 | rcontrib view.txt -ffc -fo -o images/vmx/patch_%%04d.hdr -bn 1 -b “if(-Dx0-Dy0-Dz*1,0,-1)” -m ground_mat -f reinhartb.cal -p MF=1 -b rbin -bn Nrbins -m sky_mat -ab 8 -ad 50000 -lw .00002 -lr -10 sky_1_18_9.5.oct
dctimestep -o images/tstep/tstep%%04d.hdr images/vmx/patch_%%04d.hdr sky.smx

Merry Christmas,

Nathaniel

Hi Nathaniel,

I believe this difference is due to application of the wmean() function, which only happens in the perezlum.cal (and perezlum_c.cal, skybright.cal) files, and not in the gendaymtx procedure. The purpose of this function is to mix the sky and ground luminances near the horizon, so as to avoid a hard line at altitude=0°. When you think about it, we almost never know what’s going on at the horizon anyway, unless we’re out in the middle of the ocean.

Hi Greg,

Thanks for the quick response on this one! Interestingly, the difference between the two horizon brightnesses can lead to a significant difference in DGP predictions. So I guess we should get in the habit of including terrain in our glare models.

Nathaniel