Render tregenza sky patches by rcontrib and pcomb

Dear all,

I've been trying to render the Tregenza sky patches by using rcontrib. Each patch was rendered successfully, but when I use "pcomb" which contains "tregsamp.bash" by Axel Jacobs to combine them, the "combined.hdr" was a black picture.

#vwrays -ff $vw |rcontrib @rtc1.opt -ffc $(vwrays -d $vw) -V+ -f tregenza.cal -b tbin -bn Ntbins -o first_tre_p%d.hdr -m skyglow test_sky_sun.oct

#pcomb -h $(bash apply_tregsamp_1.bash) > combine_1.hdr

#the original bash script below by Axel Jacobs was changed in order to be consistent with my code.

# Path to the patch images

imgpath="image_fisheye/patches_tre/first_tre"

for i in $imgpath_*.hdr; do
        # Scan patch number from file name
          patch=$(ls $i \
                          >rcalc -i "$imgpath_p\${pnum}.hdr" \
                           -e "\$1=pnum")
        # Get multiplier from dat file, based on record number
          multi=$(cat tmp_skydist.dat \
                          >rcalc -e "diff=$patch-recno+1;absdiff=if(diff,diff,-1*diff);

   \$1=if(absdiff,0,\$1);" |total)
          echo " -s $multi $i"

done

#EOF

Thanks,

Clarence

Hi Clarence,

Rather than trying to fix Axel's old script, it's better to use the simpler and more efficient dctimestep method:

  dctimestep first_tre_p%d.hdr skydist.dat > result.hdr

You can also simplify the rcontrib step using the rfluxmtx program, but what you have is fine.

Cheers,
-Greg

···

From: Wang Clarence <[email protected]>
Date: October 11, 2017 6:27:45 AM PDT

Dear all,

I've been trying to render the Tregenza sky patches by using rcontrib. Each patch was rendered successfully, but when I use "pcomb" which contains "tregsamp.bash" by Axel Jacobs to combine them, the "combined.hdr" was a black picture.

#vwrays -ff $vw |rcontrib @rtc1.opt -ffc $(vwrays -d $vw) -V+ -f tregenza.cal -b tbin -bn Ntbins -o first_tre_p%d.hdr -m skyglow test_sky_sun.oct

#pcomb -h $(bash apply_tregsamp_1.bash) > combine_1.hdr

#the original bash script below by Axel Jacobs was changed in order to be consistent with my code.

# Path to the patch images

imgpath="image_fisheye/patches_tre/first_tre"

for i in $imgpath_*.hdr; do
        # Scan patch number from file name
          patch=$(ls $i \
                          >rcalc -i "$imgpath_p\${pnum}.hdr" \
                           -e "\$1=pnum")
        # Get multiplier from dat file, based on record number
          multi=$(cat tmp_skydist.dat \
                          >rcalc -e "diff=$patch-recno+1;absdiff=if(diff,diff,-1*diff);

   \$1=if(absdiff,0,\$1);" |total)
          echo " -s $multi $i"

done

#EOF

Thanks,

Clarence

Hi Clarence,

The commands for rendering Tregenza Sky Patches with rfluxmtx, which Greg was referring to, can be found here: https://github.com/sariths/radTutorialFiles/blob/master/room/commands/2PM_Sky.sh. The instructions for using those files can be found in the main page of the repository: https://github.com/sariths/radTutorialFiles

If you are interested in rendering sky patches with random colors, as shown in Axel's tutorial, try this python script: https://gist.github.com/sariths/f16147efc83376c1f9c11c2f5ad24a20

Sarith

···

On 10/11/2017 10:15 PM, Wang Clarence wrote:

Thanks for the advice.

I have tried, but the "result.hdr" was not a format of picture, which meant that the rendering was failed.

#gensky 3 21 10 +s -a 22 -o 114 | genskyvec -m 1 -c 1 1 1 > tmp_skydist.dat

#vwrays -ff $vw |rcontrib @rtc1.opt -ffc $(vwrays -d $vw) -V+ -f tregenza.cal -b tbin -bn Ntbins -o first_tre_p%d.hdr -m skyglow test_sky_sun.oct

#dctimestep first_tre_p%d.hdr tmp_skydist.dat > combine.hdr

Or, any parameters should be needed in the third line?

Best,

Clarence
------------------------------------------------------------------------
*发件人:* Greg Ward <[email protected]>
*发送时间:* 2017年10月11日 18:09
*收件人:* Radiance general discussion
*主题:* Re: [Radiance-general] Render tregenza sky patches by rcontrib and pcomb
Hi Clarence,

Rather than trying to fix Axel's old script, it's better to use the simpler and more efficient dctimestep method:

dctimestep first_tre_p%d.hdr skydist.dat > result.hdr

You can also simplify the rcontrib step using the rfluxmtx program, but what you have is fine.

Cheers,
-Greg

*From: *Wang Clarence <[email protected] <mailto:[email protected]>>

*Date: *October 11, 2017 6:27:45 AM PDT

*

Dear all,

I've been trying to render the Tregenza sky patches by using rcontrib. Each patch was rendered successfully, but when I use "pcomb" which contains "tregsamp.bash" by Axel Jacobs to combine them, the "combined.hdr" was a black picture.

#vwrays -ff $vw |rcontrib @rtc1.opt -ffc $(vwrays -d $vw) -V+ -f tregenza.cal -b tbin -bn Ntbins -o first_tre_p%d.hdr -m skyglow test_sky_sun.oct

#pcomb -h $(bash apply_tregsamp_1.bash) > combine_1.hdr

#the original bash script below by Axel Jacobs was changed in order to be consistent with my code.

# Path to the patch images

imgpath="image_fisheye/patches_tre/first_tre"

for i in $imgpath_*.hdr; do
        # Scan patch number from file name
          patch=$(ls $i \
                          >rcalc -i "$imgpath_p\${pnum}.hdr" \
                           -e "\$1=pnum")
        # Get multiplier from dat file, based on record number
          multi=$(cat tmp_skydist.dat \
                          >rcalc -e "diff=$patch-recno+1;absdiff=if(diff,diff,-1*diff);

\$1=if(absdiff,0,\$1);" |total)
          echo " -s $multi $i"

done

#EOF

Thanks,

Clarence

_______________________________________________
Radiance-general mailing list
[email protected]
https://www.radiance-online.org/mailman/listinfo/radiance-general

I am using the 5.1.0.

According to my code that I mentioned before, the "combine.hdr" was rendered, but it could not be well opened and displayed like other patch images with ".hdr".

Actually, I have been also trying the method of "rfluxmtx" , then it returned " cannot load '-o'" when I run bash.

#vwrays -ff -x 600 -y 600 -vf views_up.vf | rfluxmtx @rtc.opt -v -ffc ' vwrays -d -x 600 -y 600 -vf views_up.vf ' -o sky_tre_p%d.hdr - test_sky.rad -i a.oct

I will appreciate your helping.

Best,

Clarence

···

________________________________
发件人: Greg Ward <[email protected]>
发送时间: 2017年10月12日 4:19
收件人: Radiance general discussion
主题: Re: [Radiance-general] 答复: Render tregenza sky patches by rcontrib and pcomb

Hi Clarence,

This should be correct. What version of Radiance do you have? (I.e., what does "rpict -version" return?)

Does it report any error at all? Is the output file completely empty?

It works when I run it using 5.1, and I'm pretty sure it will work for anything later than the 4.1 release, which was in 2011.

Cheers,
-Greg

From: Wang Clarence <[email protected]<mailto:[email protected]>>

Date: October 11, 2017 8:15:46 PM PDT

Thanks for the advice.

I have tried, but the "result.hdr" was not a format of picture, which meant that the rendering was failed.

#gensky 3 21 10 +s -a 22 -o 114 | genskyvec -m 1 -c 1 1 1 > tmp_skydist.dat

#vwrays -ff $vw |rcontrib @rtc1.opt -ffc $(vwrays -d $vw) -V+ -f tregenza.cal -b tbin -bn Ntbins -o first_tre_p%d.hdr -m skyglow test_sky_sun.oct

#dctimestep first_tre_p%d.hdr tmp_skydist.dat > combine.hdr

Or, any parameters should be needed in the third line?

Best,

Clarence
________________________________
发件人: Greg Ward <[email protected]<mailto:[email protected]>>
发送时间: 2017年10月11日 18:09
收件人: Radiance general discussion
主题: Re: [Radiance-general] Render tregenza sky patches by rcontrib and pcomb

Hi Clarence,

Rather than trying to fix Axel's old script, it's better to use the simpler and more efficient dctimestep method:

dctimestep first_tre_p%d.hdr skydist.dat > result.hdr

You can also simplify the rcontrib step using the rfluxmtx program, but what you have is fine.

Cheers,
-Greg

From: Wang Clarence <[email protected]<mailto:[email protected]>>

Date: October 11, 2017 6:27:45 AM PDT

Dear all,

I've been trying to render the Tregenza sky patches by using rcontrib. Each patch was rendered successfully, but when I use "pcomb" which contains "tregsamp.bash" by Axel Jacobs to combine them, the "combined.hdr" was a black picture.

#vwrays -ff $vw |rcontrib @rtc1.opt -ffc $(vwrays -d $vw) -V+ -f tregenza.cal -b tbin -bn Ntbins -o first_tre_p%d.hdr -m skyglow test_sky_sun.oct

#pcomb -h $(bash apply_tregsamp_1.bash) > combine_1.hdr

#the original bash script below by Axel Jacobs was changed in order to be consistent with my code.

# Path to the patch images

imgpath="image_fisheye/patches_tre/first_tre"

for i in $imgpath_*.hdr; do
        # Scan patch number from file name
          patch=$(ls $i \
                          >rcalc -i "$imgpath_p\${pnum}.hdr" \
                           -e "\$1=pnum")
        # Get multiplier from dat file, based on record number
          multi=$(cat tmp_skydist.dat \
                          >rcalc -e "diff=$patch-recno+1;absdiff=if(diff,diff,-1*diff);

   \$1=if(absdiff,0,\$1);" |total)
          echo " -s $multi $i"

done

#EOF

Thanks,

Clarence

Is the vwrays command definitely enclosed in back ticks?
Alternatively try this (in BASH):

vwrays -ff -x 600 -y 600 -vf views_up.vf | rfluxmtx @rtc.opt -v -ffc
$(vwrays -d -x 600 -y 600 -vf views_up.vf) -o sky_tre_p%d.hdr -
test_sky.rad -i a.oct

···

On 12 October 2017 at 08:11, Wang Clarence <[email protected]> wrote:

I am using the 5.1.0.

According to my code that I mentioned before, the "combine.hdr" was
rendered, but it could not be well opened and displayed like other patch
images with ".hdr".

Actually, I have been also trying the method of "rfluxmtx" , then it
returned " cannot load '-o'" when I run bash.

#vwrays -ff -x 600 -y 600 -vf views_up.vf | rfluxmtx @rtc.opt -v -ffc '
vwrays -d -x 600 -y 600 -vf views_up.vf ' -o sky_tre_p%d.hdr - test_sky.rad
-i a.oct

I will appreciate your helping.

Best,

Clarence

________________________________
发件人: Greg Ward <[email protected]>
发送时间: 2017年10月12日 4:19
收件人: Radiance general discussion
主题: Re: [Radiance-general] 答复: Render tregenza sky patches by rcontrib and
pcomb

Hi Clarence,

This should be correct. What version of Radiance do you have? (I.e., what
does "rpict -version" return?)

Does it report any error at all? Is the output file completely empty?

It works when I run it using 5.1, and I'm pretty sure it will work for
anything later than the 4.1 release, which was in 2011.

Cheers,
-Greg

From: Wang Clarence <[email protected]>

Date: October 11, 2017 8:15:46 PM PDT

Thanks for the advice.

I have tried, but the "result.hdr" was not a format of picture, which meant
that the rendering was failed.

#gensky 3 21 10 +s -a 22 -o 114 | genskyvec -m 1 -c 1 1 1 > tmp_skydist.dat

#vwrays -ff $vw |rcontrib @rtc1.opt -ffc $(vwrays -d $vw) -V+ -f
tregenza.cal -b tbin -bn Ntbins -o first_tre_p%d.hdr -m skyglow
test_sky_sun.oct

#dctimestep first_tre_p%d.hdr tmp_skydist.dat > combine.hdr

Or, any parameters should be needed in the third line?

Best,

Clarence
________________________________
发件人: Greg Ward <[email protected]>
发送时间: 2017年10月11日 18:09
收件人: Radiance general discussion
主题: Re: [Radiance-general] Render tregenza sky patches by rcontrib and pcomb

Hi Clarence,

Rather than trying to fix Axel's old script, it's better to use the simpler
and more efficient dctimestep method:

dctimestep first_tre_p%d.hdr skydist.dat > result.hdr

You can also simplify the rcontrib step using the rfluxmtx program, but what
you have is fine.

Cheers,
-Greg

From: Wang Clarence <[email protected]>

Date: October 11, 2017 6:27:45 AM PDT

Dear all,

I've been trying to render the Tregenza sky patches by using rcontrib. Each
patch was rendered successfully, but when I use "pcomb" which contains
"tregsamp.bash" by Axel Jacobs to combine them, the "combined.hdr" was a
black picture.

#vwrays -ff $vw |rcontrib @rtc1.opt -ffc $(vwrays -d $vw) -V+ -f
tregenza.cal -b tbin -bn Ntbins -o first_tre_p%d.hdr -m skyglow
test_sky_sun.oct

#pcomb -h $(bash apply_tregsamp_1.bash) > combine_1.hdr

#the original bash script below by Axel Jacobs was changed in order to be
consistent with my code.

# Path to the patch images

imgpath="image_fisheye/patches_tre/first_tre"

for i in $imgpath_*.hdr; do
        # Scan patch number from file name
          patch=$(ls $i \
                          >rcalc -i "$imgpath_p\${pnum}.hdr" \
                           -e "\$1=pnum")
        # Get multiplier from dat file, based on record number
          multi=$(cat tmp_skydist.dat \
                          >rcalc -e
"diff=$patch-recno+1;absdiff=if(diff,diff,-1*diff);

   \$1=if(absdiff,0,\$1);" |total)
          echo " -s $multi $i"

done

#EOF

Thanks,

Clarence

_______________________________________________
Radiance-general mailing list
[email protected]
https://www.radiance-online.org/mailman/listinfo/radiance-general

Thanks for the advice.

I have tried, but the "result.hdr" was not a format of picture, which meant that the rendering was failed.

#gensky 3 21 10 +s -a 22 -o 114 | genskyvec -m 1 -c 1 1 1 > tmp_skydist.dat

#vwrays -ff $vw |rcontrib @rtc1.opt -ffc $(vwrays -d $vw) -V+ -f tregenza.cal -b tbin -bn Ntbins -o first_tre_p%d.hdr -m skyglow test_sky_sun.oct

#dctimestep first_tre_p%d.hdr tmp_skydist.dat > combine.hdr

Or, any parameters should be needed in the third line?

Best,

Clarence

···

________________________________
发件人: Greg Ward <[email protected]>
发送时间: 2017年10月11日 18:09
收件人: Radiance general discussion
主题: Re: [Radiance-general] Render tregenza sky patches by rcontrib and pcomb

Hi Clarence,

Rather than trying to fix Axel's old script, it's better to use the simpler and more efficient dctimestep method:

dctimestep first_tre_p%d.hdr skydist.dat > result.hdr

You can also simplify the rcontrib step using the rfluxmtx program, but what you have is fine.

Cheers,
-Greg

From: Wang Clarence <[email protected]<mailto:[email protected]>>

Date: October 11, 2017 6:27:45 AM PDT

Dear all,

I've been trying to render the Tregenza sky patches by using rcontrib. Each patch was rendered successfully, but when I use "pcomb" which contains "tregsamp.bash" by Axel Jacobs to combine them, the "combined.hdr" was a black picture.

#vwrays -ff $vw |rcontrib @rtc1.opt -ffc $(vwrays -d $vw) -V+ -f tregenza.cal -b tbin -bn Ntbins -o first_tre_p%d.hdr -m skyglow test_sky_sun.oct

#pcomb -h $(bash apply_tregsamp_1.bash) > combine_1.hdr

#the original bash script below by Axel Jacobs was changed in order to be consistent with my code.

# Path to the patch images

imgpath="image_fisheye/patches_tre/first_tre"

for i in $imgpath_*.hdr; do
        # Scan patch number from file name
          patch=$(ls $i \
                          >rcalc -i "$imgpath_p\${pnum}.hdr" \
                           -e "\$1=pnum")
        # Get multiplier from dat file, based on record number
          multi=$(cat tmp_skydist.dat \
                          >rcalc -e "diff=$patch-recno+1;absdiff=if(diff,diff,-1*diff);

   \$1=if(absdiff,0,\$1);" |total)
          echo " -s $multi $i"

done

#EOF

Thanks,

Clarence

Hi Clarence,

This should be correct. What version of Radiance do you have? (I.e., what does "rpict -version" return?)

Does it report any error at all? Is the output file completely empty?

It works when I run it using 5.1, and I'm pretty sure it will work for anything later than the 4.1 release, which was in 2011.

Cheers,
-Greg

···

From: Wang Clarence <[email protected]>
Date: October 11, 2017 8:15:46 PM PDT

Thanks for the advice.

I have tried, but the "result.hdr" was not a format of picture, which meant that the rendering was failed.

#gensky 3 21 10 +s -a 22 -o 114 | genskyvec -m 1 -c 1 1 1 > tmp_skydist.dat

#vwrays -ff $vw |rcontrib @rtc1.opt -ffc $(vwrays -d $vw) -V+ -f tregenza.cal -b tbin -bn Ntbins -o first_tre_p%d.hdr -m skyglow test_sky_sun.oct

#dctimestep first_tre_p%d.hdr tmp_skydist.dat > combine.hdr

Or, any parameters should be needed in the third line?

Best,

Clarence
发件人: Greg Ward <[email protected]>
发送时间: 2017年10月11日 18:09
收件人: Radiance general discussion
主题: Re: [Radiance-general] Render tregenza sky patches by rcontrib and pcomb

Hi Clarence,

Rather than trying to fix Axel's old script, it's better to use the simpler and more efficient dctimestep method:

dctimestep first_tre_p%d.hdr skydist.dat > result.hdr

You can also simplify the rcontrib step using the rfluxmtx program, but what you have is fine.

Cheers,
-Greg

From: Wang Clarence <[email protected]>
Date: October 11, 2017 6:27:45 AM PDT

Dear all,

I've been trying to render the Tregenza sky patches by using rcontrib. Each patch was rendered successfully, but when I use "pcomb" which contains "tregsamp.bash" by Axel Jacobs to combine them, the "combined.hdr" was a black picture.

#vwrays -ff $vw |rcontrib @rtc1.opt -ffc $(vwrays -d $vw) -V+ -f tregenza.cal -b tbin -bn Ntbins -o first_tre_p%d.hdr -m skyglow test_sky_sun.oct

#pcomb -h $(bash apply_tregsamp_1.bash) > combine_1.hdr

#the original bash script below by Axel Jacobs was changed in order to be consistent with my code.

# Path to the patch images

imgpath="image_fisheye/patches_tre/first_tre"

for i in $imgpath_*.hdr; do
        # Scan patch number from file name
          patch=$(ls $i \
                          >rcalc -i "$imgpath_p\${pnum}.hdr" \
                           -e "\$1=pnum")
        # Get multiplier from dat file, based on record number
          multi=$(cat tmp_skydist.dat \
                          >rcalc -e "diff=$patch-recno+1;absdiff=if(diff,diff,-1*diff);

   \$1=if(absdiff,0,\$1);" |total)
          echo " -s $multi $i"

done

#EOF

Thanks,

Clarence

This issue was resolved off-list. There was a problem with his configuration that was causing pcomb to fail after opening 8 files. There was no issue with dctimestep after all, only the "-h" option of genskyvec.

Best,
-Greg

···

From: Wang Clarence <[email protected]>
Date: October 12, 2017 12:11:34 AM PDT

I am using the 5.1.0.

According to my code that I mentioned before, the "combine.hdr" was rendered, but it could not be well opened and displayed like other patch images with ".hdr".

Actually, I have been also trying the method of "rfluxmtx" , then it returned " cannot load '-o'" when I run bash.

#vwrays -ff -x 600 -y 600 -vf views_up.vf | rfluxmtx @rtc.opt -v -ffc ' vwrays -d -x 600 -y 600 -vf views_up.vf ' -o sky_tre_p%d.hdr - test_sky.rad -i a.oct

I will appreciate your helping.

Best,

Clarence

发件人: Greg Ward <[email protected]>
发送时间: 2017年10月12日 4:19
收件人: Radiance general discussion
主题: Re: [Radiance-general] 答复: Render tregenza sky patches by rcontrib and pcomb

Hi Clarence,

This should be correct. What version of Radiance do you have? (I.e., what does "rpict -version" return?)

Does it report any error at all? Is the output file completely empty?

It works when I run it using 5.1, and I'm pretty sure it will work for anything later than the 4.1 release, which was in 2011.

Cheers,
-Greg

From: Wang Clarence <[email protected]>
Date: October 11, 2017 8:15:46 PM PDT

Thanks for the advice.

I have tried, but the "result.hdr" was not a format of picture, which meant that the rendering was failed.

#gensky 3 21 10 +s -a 22 -o 114 | genskyvec -m 1 -c 1 1 1 > tmp_skydist.dat

#vwrays -ff $vw |rcontrib @rtc1.opt -ffc $(vwrays -d $vw) -V+ -f tregenza.cal -b tbin -bn Ntbins -o first_tre_p%d.hdr -m skyglow test_sky_sun.oct

#dctimestep first_tre_p%d.hdr tmp_skydist.dat > combine.hdr

Or, any parameters should be needed in the third line?

Best,

Clarence
发件人: Greg Ward <[email protected]>
发送时间: 2017年10月11日 18:09
收件人: Radiance general discussion
主题: Re: [Radiance-general] Render tregenza sky patches by rcontrib and pcomb

Hi Clarence,

Rather than trying to fix Axel's old script, it's better to use the simpler and more efficient dctimestep method:

dctimestep first_tre_p%d.hdr skydist.dat > result.hdr

You can also simplify the rcontrib step using the rfluxmtx program, but what you have is fine.

Cheers,
-Greg

From: Wang Clarence <[email protected]>
Date: October 11, 2017 6:27:45 AM PDT

Dear all,

I've been trying to render the Tregenza sky patches by using rcontrib. Each patch was rendered successfully, but when I use "pcomb" which contains "tregsamp.bash" by Axel Jacobs to combine them, the "combined.hdr" was a black picture.

#vwrays -ff $vw |rcontrib @rtc1.opt -ffc $(vwrays -d $vw) -V+ -f tregenza.cal -b tbin -bn Ntbins -o first_tre_p%d.hdr -m skyglow test_sky_sun.oct

#pcomb -h $(bash apply_tregsamp_1.bash) > combine_1.hdr

#the original bash script below by Axel Jacobs was changed in order to be consistent with my code.

# Path to the patch images

imgpath="image_fisheye/patches_tre/first_tre"

for i in $imgpath_*.hdr; do
        # Scan patch number from file name
          patch=$(ls $i \
                          >rcalc -i "$imgpath_p\${pnum}.hdr" \
                           -e "\$1=pnum")
        # Get multiplier from dat file, based on record number
          multi=$(cat tmp_skydist.dat \
                          >rcalc -e "diff=$patch-recno+1;absdiff=if(diff,diff,-1*diff);

   \$1=if(absdiff,0,\$1);" |total)
          echo " -s $multi $i"

done

#EOF

Thanks,

Clarence