illum-like behaviour for sky dome

Dear list,

I have a brightfunc applied to the glow of the sky dome. I would like this pattern to be visible to the camera, but use a normal gensky generated sky for all sample rays.

Conceptually, this is similar to the illum type where a different material is applied when the object (the sky in my case) is viewed directly.

I did try with illum:

skyfunc glow skyglow
0
4 1 1 1 0

skyglow brightfunc bracelet
2 band bracelet.cal
0

skyfunc illum skymat
1 bracelet
0
3 1 1 1

skymat source sky
0
4 0 0 1 180

This works, but results in about twice the horizontal illuminance compared to a normal glow sky. The sky now takes part in the direct calculation (this works with -ab 0), and all light expectedly emenates from the zenith. So using illum is not an option.

Many thanks for your ideas

Axel

What about separating the skies into two different octrees, then
combining two images with pcomb? If you render your intended visible sky
with zero ambient bounces then it won't contribute to the scene
illumination in its image. And if the gensky is defined as an illum (or
somehow masked out afterward) it will contribute only to the scene
illumination and be otherwise invisible in the composite.

···

____________________________________________________________
Electronic mail messages entering and leaving Arup business
systems are scanned for acceptability of content and viruses

Hi Axel,

Your sky is probably twice as bright because without turning on direct jittering, all ray samples will be taken from the zenith, neglecting to integrate the cosine factor. You can try again with -dj 1, but I don't think you'll like the noisy results.

A better approach is to remove the significant low frequencies from your sky, replacing them with the desired gensky or gendaylit distribution. See the following entry in a thread from a couple years ago:

  http://www.radiance-online.org/pipermail/radiance-general/2008-May/005046.html

Christopher's suggestion is also a good one. You can save the depth buffer using the -z option, convert it to an image, then use pcomb to select for depths greater than 1e9 as the sky, like so:

  rpict ... -x 1024 -y 768 -pa 0 -pj 0 -vf view1.vf -z view1.zbf scene.oct > view1.hdr
  rpict ... -x 1024 -y 768 -pa 0 -pj 0 -vf view1.vf sky_only.oct > view1sky.hdr
  pvalue -r -h -y 768 +x 1024 -df view1.zbf | pcomb -e 'sel=if(gi(3)-1e9,2,1)' \
      -e 'ro=ri(sel);go=gi(sel);bo=bi(sel)' view1.hdr view1sky.hdr - \
      > pfilt -1 -r .6 -x /3 -y /3 > filtered.hdr

The sky_only.oct contains the nice, captured sky you wish to reproduce. The final pfilt improves the appearance substantially. The -pj 0 turns off the usual pixel jittering, which can lead to some aliasing but is necessary to get exact pixel correspondence between renderings. I'm sure you can figure out the rest, fixing any mistakes I made above.

Cheers,
-Greg

···

From: Axel Jacobs <[email protected]>
Date: May 23, 2010 2:51:52 PM PDT

Dear list,

I have a brightfunc applied to the glow of the sky dome. I would like this pattern to be visible to the camera, but use a normal gensky generated sky for all sample rays.

Conceptually, this is similar to the illum type where a different material is applied when the object (the sky in my case) is viewed directly.

I did try with illum:

skyfunc glow skyglow
0
4 1 1 1 0

skyglow brightfunc bracelet
2 band bracelet.cal
0

skyfunc illum skymat
1 bracelet
0
3 1 1 1

skymat source sky
0
4 0 0 1 180

This works, but results in about twice the horizontal illuminance compared to a normal glow sky. The sky now takes part in the direct calculation (this works with -ab 0), and all light expectedly emenates from the zenith. So using illum is not an option.

Many thanks for your ideas

Axel

I love how you can whip up these fun image recipes, Greg!

···

On May 24, 2010, at 10:46 AM, Greg Ward wrote:

Hi Axel,

Your sky is probably twice as bright because without turning on direct jittering, all ray samples will be taken from the zenith, neglecting to integrate the cosine factor. You can try again with -dj 1, but I don't think you'll like the noisy results.

A better approach is to remove the significant low frequencies from your sky, replacing them with the desired gensky or gendaylit distribution. See the following entry in a thread from a couple years ago:

  http://www.radiance-online.org/pipermail/radiance-general/2008-May/005046.html

Christopher's suggestion is also a good one. You can save the depth buffer using the -z option, convert it to an image, then use pcomb to select for depths greater than 1e9 as the sky, like so:

  rpict ... -x 1024 -y 768 -pa 0 -pj 0 -vf view1.vf -z view1.zbf scene.oct > view1.hdr
  rpict ... -x 1024 -y 768 -pa 0 -pj 0 -vf view1.vf sky_only.oct > view1sky.hdr
  pvalue -r -h -y 768 +x 1024 -df view1.zbf | pcomb -e 'sel=if(gi(3)-1e9,2,1)' \
      -e 'ro=ri(sel);go=gi(sel);bo=bi(sel)' view1.hdr view1sky.hdr - \
      > pfilt -1 -r .6 -x /3 -y /3 > filtered.hdr

The sky_only.oct contains the nice, captured sky you wish to reproduce. The final pfilt improves the appearance substantially. The -pj 0 turns off the usual pixel jittering, which can lead to some aliasing but is necessary to get exact pixel correspondence between renderings. I'm sure you can figure out the rest, fixing any mistakes I made above.

Cheers,
-Greg

From: Axel Jacobs <[email protected]>
Date: May 23, 2010 2:51:52 PM PDT

Dear list,

I have a brightfunc applied to the glow of the sky dome. I would like this pattern to be visible to the camera, but use a normal gensky generated sky for all sample rays.

Conceptually, this is similar to the illum type where a different material is applied when the object (the sky in my case) is viewed directly.

I did try with illum:

skyfunc glow skyglow
0
0
4 1 1 1 0

skyglow brightfunc bracelet
2 band bracelet.cal
0
0

skyfunc illum skymat
1 bracelet
0
3 1 1 1

skymat source sky
0
0
4 0 0 1 180

This works, but results in about twice the horizontal illuminance compared to a normal glow sky. The sky now takes part in the direct calculation (this works with -ab 0), and all light expectedly emenates from the zenith. So using illum is not an option.

Many thanks for your ideas

Axel

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

Yes, well, I also tend to goof -- forgot the -b option needed for pvalue.

-Greg

···

I love how you can whip up these fun image recipes, Greg!

On May 24, 2010, at 10:46 AM, Greg Ward wrote:

Hi Axel,

Your sky is probably twice as bright because without turning on direct
jittering, all ray samples will be taken from the zenith, neglecting to
integrate the cosine factor. You can try again with -dj 1, but I don't
think you'll like the noisy results.

A better approach is to remove the significant low frequencies from your
sky, replacing them with the desired gensky or gendaylit distribution.
See the following entry in a thread from a couple years ago:

  http://www.radiance-online.org/pipermail/radiance-general/2008-May/005046.html

Christopher's suggestion is also a good one. You can save the depth
buffer using the -z option, convert it to an image, then use pcomb to
select for depths greater than 1e9 as the sky, like so:

  rpict ... -x 1024 -y 768 -pa 0 -pj 0 -vf view1.vf -z view1.zbf
scene.oct > view1.hdr
  rpict ... -x 1024 -y 768 -pa 0 -pj 0 -vf view1.vf sky_only.oct >
view1sky.hdr
  pvalue -r -h -y 768 +x 1024 -df view1.zbf | pcomb -e
'sel=if(gi(3)-1e9,2,1)' \
      -e 'ro=ri(sel);go=gi(sel);bo=bi(sel)' view1.hdr view1sky.hdr - \
      > pfilt -1 -r .6 -x /3 -y /3 > filtered.hdr

The sky_only.oct contains the nice, captured sky you wish to reproduce.
The final pfilt improves the appearance substantially. The -pj 0 turns
off the usual pixel jittering, which can lead to some aliasing but is
necessary to get exact pixel correspondence between renderings. I'm
sure you can figure out the rest, fixing any mistakes I made above.

Cheers,
-Greg

From: Axel Jacobs <[email protected]>
Date: May 23, 2010 2:51:52 PM PDT

Dear list,

I have a brightfunc applied to the glow of the sky dome. I would like
this pattern to be visible to the camera, but use a normal gensky
generated sky for all sample rays.

Conceptually, this is similar to the illum type where a different
material is applied when the object (the sky in my case) is viewed
directly.

I did try with illum:

skyfunc glow skyglow
0
0
4 1 1 1 0

skyglow brightfunc bracelet
2 band bracelet.cal
0
0

skyfunc illum skymat
1 bracelet
0
3 1 1 1

skymat source sky
0
0
4 0 0 1 180

This works, but results in about twice the horizontal illuminance
compared to a normal glow sky. The sky now takes part in the direct
calculation (this works with -ab 0), and all light expectedly emenates
from the zenith. So using illum is not an option.

Many thanks for your ideas

Axel

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

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

Chris, Greg,

thank you for the suggestions and for reminding me about the -pj 0 option which is important in this case.

I took the liberty of uploading a zbuffer image for those of you that have never seen one (I don't think there is that many applications for it):
http://www.luxal.eu/pickup/zbf_normtiff.jpg

A zbuffer stores the distance to the objects as a grey value: Black is very close, white very far away. When converting the zbuffer file to an image, the -p[RGB] option needs to be set, since the zbuffer has only one channel.

pvalue -r -h -y 768 +x 1024 -df -pG view1.zbf > zbf.hdr

The approach suggested by Greg works well. However, I ended up with a slightly different approach: Image one has the normal sky and is rendered with 'normal' options. Image two has the fancy sky in it and is rendered with -ab 0, making all objects except the sky black (as long as the sun is switched off). I then use pcomb, telling it to use the pixel from the normal image if the fancy sky image is black at that point, and to use the pixel from the fancy sky otherwise.

RES=600
rpict $AMB -pj 0 -x $RES -y $RES -vf views/nice.vf \
normal.oct > images/normal.hdr
rpict $AMB -ab 0 -pj 0 -x $RES -y $RES -vf views/nice.vf \
bracelet.oct > images/fancymask.hdr

pcomb -e 'sel=if(gi(2),2,1)' -e 'ro=ri(sel);go=gi(sel);bo=bi(sel)' \
images/normal.hdr images/fancymask.hdr > images/combined.hdr

Here is the final result, with the solar bracelet 'painted' onto the sky. The zebra stripes indicate the hours of the day:
http://www.luxal.eu/pickup/combined_pfilt.jpg

I did not pursue the mapping approach further since my solar bracelet is parametric rather than an image.

Cheers

Axel