[Radiance-general] sky visibility

Ji Zhang hope.zh at gmail.com
Thu Oct 25 11:11:58 PDT 2012


Hi, Lars, Thanks for your detailed explanation!

The following bash script is put up according to the suggestions from all
previous replies to this post. This method is view type independent.
Anyway, I'd appreciate further advices from the list to make it more
succinct and efficient, or point out the loopholes if there are any.

# start__________________________
# calculate Sky Exposure Factor
# which is defined as the ratio between
# the solid angle subtended by visible sky patch/patches
# and that of the unobstructed sky hemisphere (which is 2*PI)
oconv ./plastic_mat.rad ./geom.rad > ./SkyEF_scene.oct
rpict -av 1 1 1 -vf ./view_vts.vf -x 1000 -y 1000 ./SkyEF_scene.oct | pcomb
-e 'solidAngle=S(1);ro=if(ri(1),0,solidAngle); go=if(gi(1),0,solidAngle);
bo=if(bi(1),0,solidAngle)' -o - | pvalue -h -H | rcalc -e '$1=$3' | total |
rcalc -e '$1=$1/2/PI' > ./SkyEF_results.txt
# end__________________________

The contents of "view_vts.vf" (note that the location of the view point is
slightly away from the surface of the scene geometry):
rvu -vts -vp 0 0 0.001 -vd 0 0 1 -vu 0 1 0 -vh 180 -vv 180 -vo 0 -va 0 -vs
0 -vl 0


The following step-by-step break down of the commands might be useful for
debugging purpose.

# start__________________________
oconv ./plastic_mat.rad ./geom.rad > ./SkyEF_scene.oct

rpict -av 1 1 1 -vf ./view_vts.vf -x 800 -y 800 ./SkyEF_scene.oct >
./SkyEF_vts.hdr

cat ./SkyEF_vts.hdr | pcomb -e 'omega=S(1);ro=if(ri(1),0,omega);
go=if(gi(1),0,omega); bo=if(bi(1),0,omega)' -o - > ./SkyEF_solidAngle.hdr

cat ./SkyEF_solidAngle.hdr | pvalue -h -H >
./SkyEF_xpos_ypos_solidAngleVal.txt

cat ./SkyEF_xpos_ypos_solidAngleVal.txt | rcalc -e '$1=$3' | total >
./SkyEF_total_solidAngle_of_visible_sky.txt

cat ./SkyEF_total_solidAngle_of_visible_sky.txt | rcalc -e '$1=$1/2/PI' >
./SkyEF_results.txt
# end__________________________


Thanks again for the help from all of you!
- Ji


On Thu, Oct 25, 2012 at 4:20 PM, Lars O. Grobe <grobe at gmx.net> wrote:

> Hi Ji!
>
> The functions S(n) and T(n) are available in pcomb. To make an image
> "solid_angles.hdr" with pixel values (r=g=b) being equal to the solid angle
> of the pixel in sr, you would do the following:
>
> cat image.hdr |  pcomb -e 'omega=S(1); ro=omega; go=omega; bo=omega' -o -
> > solid_angles.hdr
>
> So S(n) gives, for each pixel of the n'th input image, its solid angle. To
> take a look, use falsecolor -m 1 -s .000008 -ip solidangle.hdr | ximage -
> good way to think about projections...
>
> Cheers, Lars.
>
>
> > Hi, Lars, thanks a lot for your advices!
> >
> > May I ask the references on the S and T function as you suggested to
> look up? (I didn't find any relevant infor via Radiance forum search...)
> >
> > May I also ask what the "n" in the "S(n)" denotes?
> >
> > Thanks again!
> >
> > - Cheers, Ji
>
>
> _______________________________________________
> Radiance-general mailing list
> Radiance-general at radiance-online.org
> http://www.radiance-online.org/mailman/listinfo/radiance-general
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.radiance-online.org/pipermail/radiance-general/attachments/20121026/b2e319fc/attachment.html>


More information about the Radiance-general mailing list