[Radiance-general] sky visibility

Ji Zhang hope.zh at gmail.com
Sun Dec 2 08:16:47 PST 2012


Hi, Greg, a follow-up based on some quick tests:

Maybe we still need to include the following definition of a "bright"
ground into the octree:

#___________________________
# content of SkyEF_ground.rad file
!gensky 6 21 +15.0  -a 1.0 -o 103.0 -m -105 -u -B 1.0

skyfunc glow ground_glow
0
0
4 1 1 1 0

ground_glow source ground
0
0
4 0 0 -1 180
#___________________________


It is to prevent some of the visible part of the ground below horizon
(rendered as black by rpict in your way) from being mistakenly recognized
as part of the sky (also rendered as black) in the pcomb related processing
...

- Cheers, Ji



On Sun, Dec 2, 2012 at 8:26 PM, Ji Zhang <hope.zh at gmail.com> wrote:

> Thank you very much, Greg!
>
> The method is faster (around 50% faster) now according to your suggestion!
>
> I understand from your advise that there's no need to model the uniform
> sky, and using the "-av 1 1 1" option for rpict can literally "color" the
> geometries visible from the view specified  in light grey so that they can
> be differentiated from the visible sky patch(es) which is rendered as black
> in this case.
>
> And also, the pcomb part of calculation can be performed for just one of
> the RGB channels.
>
> Thanks again!
>
> - Ji
>
>
>
> On Sun, Dec 2, 2012 at 2:26 AM, Greg Ward <gregoryjward at gmail.com> wrote:
>
>> Ji,
>>
>> My suggestion is to simplify your command.  Most of your time is probably
>> being spent in pcomb, unless your scene is extremely complex.  Try:
>>
>> oconv -f ./plastic_mat.rad ./geom.rad \
>> | rpict -av 1 1 1 -vf view_vts.vf -x 1000 -y 1000 \
>> | pcomb -e 'lo=if(gi(1),0,S(1))' - \
>>  | pvalue -h -H -pG -d \
>> | total \
>> | rcalc -e '$1=$1/2/PI' > ./SkyEF_results.txt
>>
>> Best,
>> -Greg
>>
>> *From: *Ji Zhang <hope.zh at gmail.com>
>>
>> *Date: *November 30, 2012 12:50:56 AM HST
>>
>> *
>> *
>>
>> Dear list,
>>
>> I'd like to ask if the Radiance way to calculate sky exposure as
>> explained below can be further optimized.
>>
>> This method is quite accurate, but it is just not fast enough for us (0.2
>> second per sensor).
>>
>> It seems the Radiance programs used in this approach, such as rpict,
>> pcomb, pvalue, etc. are not applicable to harvest the power of parallel
>> processing, such as what the "-n" option does for rtrace.
>>
>> Maybe I'm just too greedy, but is there a way to further enhance the
>> efficiency of the individual Radiance command in this method?
>>
>> Thanks in advance!
>>
>> - Ji
>>
>>
>> On Fri, Oct 26, 2012 at 2:11 AM, Ji Zhang <hope.zh at gmail.com> wrote:
>>
>>> 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
>>>>
>>>
>>>
>> _______________________________________________
>> Radiance-general mailing list
>> Radiance-general at radiance-online.org
>> http://www.radiance-online.org/mailman/listinfo/radiance-general
>>
>>
>> _______________________________________________
>> 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/20121203/e0ff1b6f/attachment-0001.html>


More information about the Radiance-general mailing list