rendering with environment maps

Hi there,

I have a question about rendering with environment maps. I set up a scene
consisting of two spheres, one completely specular and one Lambertian, lit
it with one of Paul Debevec's light probes (
http://www.pauldebevec.com/Probes/). The specular sphere is rendering fine,
but the Lambertian one is turning up completely black, and I have no idea
why.

My code looks like this:

# make environment map
void colorpict uff
9 red green blue uffizi_probe.hdr angmap.cal sb_u sb_v -rx 90
0 0

uff glow uff_glow
0 0 4 1 1 1 0

!genbox uff_glow boxenv 100 100 100 -i | xform -t -50 -50 -50

# make materials
void plastic spec # specular
0 0 5 .5 .5 .5 1.000000 0.000000

void plastic lamb # Lambertian
0 0 5 1 1 1 0.0 0.0

# make spheres
spec sphere sph1 # specular
0 0 4 -.5000000 0.000000 0.000000 0.300000

lamb sphere sph2 # Lambertian
0 0 4 .5000000 0.000000 0.000000 0.300000

I then ran it like this:

oconv scene.rad > scene.oct
rvu -vtv -vv 10 -vh 10 -vp 0 -10 0 scene.oct

When I do this, I get a mirrored sphere and a completely black sphere. To
make sure that the problem wasn't with my code, I downloaded this sample
code from Debevec's website (http://www.pauldebevec.com/RNL/Source/). When
I changed the materials in the .rad file to be Lambertian (lines 182-190 in
rnl_scene.rad), the objects rendered as completely black.

Has anybody ever run into this problem before? I am using RADIANCE 4.2, on
OS X 10.7 (home) and OS X 10.9 (work).

Regards,

MJ

You need to throw in an "-ab 1" (or higher) in the rvu line. The HDR image
does not count as light source and so does not "illuminate" objects with
the default of "-ab 0". If you had more geometry in the scene you would
notice that everything is dark. The only thing you see is the HDR image
itself in direct view or reflected in the sphere (reflection is calculated
independently of the light distribution).

Regards,
Thomas

···

On Mon, Jul 20, 2015 at 8:41 PM, Minjung Kim <[email protected]> wrote:

Hi there,

I have a question about rendering with environment maps. I set up a scene
consisting of two spheres, one completely specular and one Lambertian, lit
it with one of Paul Debevec's light probes (
http://www.pauldebevec.com/Probes/\). The specular sphere is rendering
fine, but the Lambertian one is turning up completely black, and I have no
idea why.

My code looks like this:

# make environment map
void colorpict uff
9 red green blue uffizi_probe.hdr angmap.cal sb_u sb_v -rx 90
0 0

uff glow uff_glow
0 0 4 1 1 1 0

!genbox uff_glow boxenv 100 100 100 -i | xform -t -50 -50 -50

# make materials
void plastic spec # specular
0 0 5 .5 .5 .5 1.000000 0.000000

void plastic lamb # Lambertian
0 0 5 1 1 1 0.0 0.0

# make spheres
spec sphere sph1 # specular
0 0 4 -.5000000 0.000000 0.000000 0.300000

lamb sphere sph2 # Lambertian
0 0 4 .5000000 0.000000 0.000000 0.300000

I then ran it like this:

oconv scene.rad > scene.oct
rvu -vtv -vv 10 -vh 10 -vp 0 -10 0 scene.oct

When I do this, I get a mirrored sphere and a completely black sphere. To
make sure that the problem wasn't with my code, I downloaded this sample
code from Debevec's website (http://www.pauldebevec.com/RNL/Source/\).
When I changed the materials in the .rad file to be Lambertian (lines
182-190 in rnl_scene.rad), the objects rendered as completely black.

Has anybody ever run into this problem before? I am using RADIANCE 4.2, on
OS X 10.7 (home) and OS X 10.9 (work).

Regards,

MJ

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

Thanks so much for your help, Thomas! That did the trick.

I have two follow-up questions:

(1) When I set the environment map, I also tried including an additional
direct light source. Shouldn't the direct source have illuminated the
Lambertian sphere? I tried setting the intensity of the direct source to be
very high and the environment map to be low, just in case the environment
map was washing out the influence of the direct source -- but still, the
Lambertian sphere rendered completely black. Is it not possible to combine
the environment map with additional light sources?

(2) I want the lighting to be from an environment map, but there to be
additional "environment" that the specular object reflects. More precisely,
I want the specular object to be reflecting a world defined by a texture
pattern, but using the lighting pattern from an environment map. Does that
make sense?

Regards,

MJ

···

On Mon, Jul 20, 2015 at 11:16 PM, Thomas Bleicher <[email protected]> wrote:

You need to throw in an "-ab 1" (or higher) in the rvu line. The HDR image
does not count as light source and so does not "illuminate" objects with
the default of "-ab 0". If you had more geometry in the scene you would
notice that everything is dark. The only thing you see is the HDR image
itself in direct view or reflected in the sphere (reflection is calculated
independently of the light distribution).

Regards,
Thomas

On Mon, Jul 20, 2015 at 8:41 PM, Minjung Kim <[email protected]> wrote:

Hi there,

I have a question about rendering with environment maps. I set up a scene
consisting of two spheres, one completely specular and one Lambertian, lit
it with one of Paul Debevec's light probes (
http://www.pauldebevec.com/Probes/\). The specular sphere is rendering
fine, but the Lambertian one is turning up completely black, and I have no
idea why.

My code looks like this:

# make environment map
void colorpict uff
9 red green blue uffizi_probe.hdr angmap.cal sb_u sb_v -rx 90
0 0

uff glow uff_glow
0 0 4 1 1 1 0

!genbox uff_glow boxenv 100 100 100 -i | xform -t -50 -50 -50

# make materials
void plastic spec # specular
0 0 5 .5 .5 .5 1.000000 0.000000

void plastic lamb # Lambertian
0 0 5 1 1 1 0.0 0.0

# make spheres
spec sphere sph1 # specular
0 0 4 -.5000000 0.000000 0.000000 0.300000

lamb sphere sph2 # Lambertian
0 0 4 .5000000 0.000000 0.000000 0.300000

I then ran it like this:

oconv scene.rad > scene.oct
rvu -vtv -vv 10 -vh 10 -vp 0 -10 0 scene.oct

When I do this, I get a mirrored sphere and a completely black sphere. To
make sure that the problem wasn't with my code, I downloaded this sample
code from Debevec's website (http://www.pauldebevec.com/RNL/Source/\).
When I changed the materials in the .rad file to be Lambertian (lines
182-190 in rnl_scene.rad), the objects rendered as completely black.

Has anybody ever run into this problem before? I am using RADIANCE 4.2,
on OS X 10.7 (home) and OS X 10.9 (work).

Regards,

MJ

_______________________________________________
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

Hi

Sorry for replying late. I didn't have time for email yesterday.

1) Perhaps your use of the "glow" material for the environment box stops
the direct calculation from reaching the light source? Can you post the
definition of your light source? I know a combination of HDR mapped to a
sky dome and other light sources can be done but I'm not sure if this works
with a box, too.

2a) You can render the image of the environment map on the reflecting
sphere separately from the main scene and then just combine the two images.
You won't have the lighting pattern on the mirrored object, though. Perhaps
there is a way to capture the lighting pattern with a lambertian material
and multiply the values from both images? You'd have to make sure that your
environment texture captures accurate lighting data.

2b) Instead of reflecting a texture in the mirror ball you could just apply
the texture directly to the mirror. What real-world physical effect do you
want to simulate?

···

On Tue, Jul 21, 2015 at 12:24 PM, Minjung Kim <[email protected]> wrote:

Thanks so much for your help, Thomas! That did the trick.

I have two follow-up questions:

(1) When I set the environment map, I also tried including an additional
direct light source. Shouldn't the direct source have illuminated the
Lambertian sphere? I tried setting the intensity of the direct source to be
very high and the environment map to be low, just in case the environment
map was washing out the influence of the direct source -- but still, the
Lambertian sphere rendered completely black. Is it not possible to combine
the environment map with additional light sources?

(2) I want the lighting to be from an environment map, but there to be
additional "environment" that the specular object reflects. More precisely,
I want the specular object to be reflecting a world defined by a texture
pattern, but using the lighting pattern from an environment map. Does that
make sense?

Regards,

MJ

On Mon, Jul 20, 2015 at 11:16 PM, Thomas Bleicher <[email protected]> > wrote:

You need to throw in an "-ab 1" (or higher) in the rvu line. The HDR
image does not count as light source and so does not "illuminate" objects
with the default of "-ab 0". If you had more geometry in the scene you
would notice that everything is dark. The only thing you see is the HDR
image itself in direct view or reflected in the sphere (reflection is
calculated independently of the light distribution).

Regards,
Thomas

On Mon, Jul 20, 2015 at 8:41 PM, Minjung Kim <[email protected]> wrote:

Hi there,

I have a question about rendering with environment maps. I set up a
scene consisting of two spheres, one completely specular and one
Lambertian, lit it with one of Paul Debevec's light probes (
http://www.pauldebevec.com/Probes/\). The specular sphere is rendering
fine, but the Lambertian one is turning up completely black, and I have no
idea why.

My code looks like this:

# make environment map
void colorpict uff
9 red green blue uffizi_probe.hdr angmap.cal sb_u sb_v -rx 90
0 0

uff glow uff_glow
0 0 4 1 1 1 0

!genbox uff_glow boxenv 100 100 100 -i | xform -t -50 -50 -50

# make materials
void plastic spec # specular
0 0 5 .5 .5 .5 1.000000 0.000000

void plastic lamb # Lambertian
0 0 5 1 1 1 0.0 0.0

# make spheres
spec sphere sph1 # specular
0 0 4 -.5000000 0.000000 0.000000 0.300000

lamb sphere sph2 # Lambertian
0 0 4 .5000000 0.000000 0.000000 0.300000

I then ran it like this:

oconv scene.rad > scene.oct
rvu -vtv -vv 10 -vh 10 -vp 0 -10 0 scene.oct

When I do this, I get a mirrored sphere and a completely black sphere.
To make sure that the problem wasn't with my code, I downloaded this sample
code from Debevec's website (http://www.pauldebevec.com/RNL/Source/\).
When I changed the materials in the .rad file to be Lambertian (lines
182-190 in rnl_scene.rad), the objects rendered as completely black.

Has anybody ever run into this problem before? I am using RADIANCE 4.2,
on OS X 10.7 (home) and OS X 10.9 (work).

Regards,

MJ

_______________________________________________
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

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

Hi,

1) Perhaps your use of the "glow" material for the environment box stops

the direct calculation from reaching the light source? Can you post the
definition of your light source? I know a combination of HDR mapped to a
sky dome and other light sources can be done but I'm not sure if this works
with a box, too.

# Direct source
void light lt
0
0
3 1 1 0 # The light colour is yellow, so if my white ball is lit yellow, I
know that this light has an effect.
             # I've also tried varying the intensity of the RGB values here
with respect to the RGB values of the environment map.

lt source ltsource
0
0
4 0 -1 1 1

# Environment map
void colorpict uff
9 red green blue uffizi_probe.hdr angmap.cal sb_u sb_v -rx 90
0
0

uff glow uff_glow
0
0
4 1 1 1 0

!genbox uff_glow boxenv 100 100 100 -i | xform -t -50 -50 -50

2a) You can render the image of the environment map on the reflecting
sphere separately from the main scene and then just combine the two images.
You won't have the lighting pattern on the mirrored object, though. Perhaps
there is a way to capture the lighting pattern with a lambertian material
and multiply the values from both images? You'd have to make sure that your
environment texture captures accurate lighting data.

2b) Instead of reflecting a texture in the mirror ball you could just
apply the texture directly to the mirror. What real-world physical effect
do you want to simulate?

My goal is to be able to render a completely specular object in different
scenes ("worlds," let's say), e.g., white noise, 1/f noise, polka dots, &c.
Normally, I would set up a scene thus:

- put the object in the world origin
- place a light source or light sources
- place a giant box around the scene, and texture the inside of the box
with the desired world (e.g., white noise)

But what I actually want to do is use naturalistic lighting, captured from
light probes, hence my question. But maybe this is a nonsensical thing to
do, since the light probes contain scene structure in there? I'm not sure.

Thanks so much for your help!

Regards,

MJ

I had some time over the weekend to an HDR map applied to a box. The glow
material does indeed block out the light from a directional light source.
You can work around this by using the "source" material type with a 360
degree angle to define a sky dome that has the HDR image applied.

void colorpict sky_map
7 red green blue envmap.hdr skymap.cal map_u map_v
0
1 1.0

sky_map glow sky_mat
0
0
4 1 1 1 0

sky_mat source sky
0
0
4 0 0 1 360

I have uploaded an example scene that contains an image based sky and a
light source. The necessary "skymap.cal" file and a suitable HDR image for
the sky map are included.

https://www.dropbox.com/s/t2d682sm1grrfbx/env_and_light.zip?dl=0

This mapping requires the image to be a rectangular panoramic image. I
think there was a command line to convert the angular HDR images to a
panoramic projection but I couldn't find it.

With this method you can place your object in the scene and place some
additional lights in addition to the lighting embedded in the environment
map. If you want to illuminate the object by a different HDR image than the
environment map you can create a scene and for the lighting and render the
object with clipping planes just before and after the object to remove all
of the lighting map from the image. Then you render the "background" using
the environment map without object and combine both images with pcomb:

pcomb -e 'ro=if(ri(1)-.5,ri(1),ri(2));go=if(gi(1)-.5,gi(1),gi(2));
bo=if(bi(1)-.5,bi(1),bi(2));' \
         object.hdr background.hdr > combined.hdr

You can read more on this here:

Hth,
Thomas

···

On Wed, Jul 22, 2015 at 4:42 PM, Minjung Kim <[email protected]> wrote:

Hi,

1) Perhaps your use of the "glow" material for the environment box stops

the direct calculation from reaching the light source? Can you post the
definition of your light source? I know a combination of HDR mapped to a
sky dome and other light sources can be done but I'm not sure if this works
with a box, too.

# Direct source
void light lt
0
0
3 1 1 0 # The light colour is yellow, so if my white ball is lit yellow,
I know that this light has an effect.
             # I've also tried varying the intensity of the RGB values
here with respect to the RGB values of the environment map.

lt source ltsource
0
0
4 0 -1 1 1

# Environment map
void colorpict uff
9 red green blue uffizi_probe.hdr angmap.cal sb_u sb_v -rx 90
0
0

uff glow uff_glow
0
0
4 1 1 1 0

!genbox uff_glow boxenv 100 100 100 -i | xform -t -50 -50 -50

2a) You can render the image of the environment map on the reflecting
sphere separately from the main scene and then just combine the two images.
You won't have the lighting pattern on the mirrored object, though. Perhaps
there is a way to capture the lighting pattern with a lambertian material
and multiply the values from both images? You'd have to make sure that your
environment texture captures accurate lighting data.

2b) Instead of reflecting a texture in the mirror ball you could just
apply the texture directly to the mirror. What real-world physical effect
do you want to simulate?

My goal is to be able to render a completely specular object in different
scenes ("worlds," let's say), e.g., white noise, 1/f noise, polka dots, &c.
Normally, I would set up a scene thus:

- put the object in the world origin
- place a light source or light sources
- place a giant box around the scene, and texture the inside of the box
with the desired world (e.g., white noise)

But what I actually want to do is use naturalistic lighting, captured from
light probes, hence my question. But maybe this is a nonsensical thing to
do, since the light probes contain scene structure in there? I'm not sure.

Thanks so much for your help!

Regards,

MJ

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