# calculation of one reflection (rtrace)

Hi,

I try to understand how RADIANCE calculate the radiance values, but the specular value for one reflection isn't clear.
I understand, that the diffuse value is independent of view. On point P_r=(0 1 1) I got from rtrace for the red channel 0.22361, I calculated:

R_r_light=100
distance=2.2360
rho_surf1=0.1
cos(63,43) = light incoming angle

R_r(0,1,1) = R_r_light * (sphere_radius)² / (distance)² * cos (63,43) * rho_surf1 = 0.223606797.

Ok, this value is fine, but what will happen if I look from (0 -1 1) to (0 1 -1) at point (0, 0, 0), I thought this, but it didn't work:

distance=3
rho_mirr=0.3
diff=0.9
spec=0.1
cos(45) = reflected light - observer angle
P_r=0.22361

R_r(0,0,0) = R_r_light * (sphere_radius)² / (distance)² * rho_mirr * diff + spec * P_r * cos(45) = 0.765811388

rtrace = 0.76517

Can somebody explain how the specular component is calculated on my test scene? I do not get it...

Here is my test scene:

void plastic mirr
0
5 .3 .2 .1 0.1 0

void plastic surf1
0
5 .1 .1 .1 0 0

void light lighty20
0
3 100 150 200

mirr polygon plate1
0
12
-1 -1 0
1 -1 0
1 1 0
-1 1 0

surf1 polygon plate2
0
12
-1 1 0
-1 1 3
1 1 3
1 1 0

lighty20 sphere light_s
0
4 0 0 3 0.5

Hi Robert,

There is a Fresnel correction that puts more energy into the specular component at low angles, and even though 45 degrees isn't a very low angle, your differences are in the 4th significant digit. I think this is the source of the discrepancy.

-Greg

···

From: Robert Franke <robertfranke@gmx.de>
Date: June 27, 2012 2:41:26 PM PDT

Hi,

I try to understand how RADIANCE calculate the radiance values, but the specular value for one reflection isn't clear.
I understand, that the diffuse value is independent of view. On point P_r=(0 1 1) I got from rtrace for the red channel 0.22361, I calculated:

R_r_light=100
distance=2.2360
rho_surf1=0.1
cos(63,43) = light incoming angle

R_r(0,1,1) = R_r_light * (sphere_radius)² / (distance)² * cos (63,43) * rho_surf1 = 0.223606797.

Ok, this value is fine, but what will happen if I look from (0 -1 1) to (0 1 -1) at point (0, 0, 0), I thought this, but it didn't work:

distance=3
rho_mirr=0.3
diff=0.9
spec=0.1
cos(45) = reflected light - observer angle
P_r=0.22361

R_r(0,0,0) = R_r_light * (sphere_radius)² / (distance)² * rho_mirr * diff + spec * P_r * cos(45) = 0.765811388

rtrace = 0.76517

Can somebody explain how the specular component is calculated on my test scene? I do not get it...

Here is my test scene:

void plastic mirr
0
0
5 .3 .2 .1 0.1 0

void plastic surf1
0
0
5 .1 .1 .1 0 0

void light lighty20
0
0
3 100 150 200

mirr polygon plate1
0
0
12
-1 -1 0
1 -1 0
1 1 0
-1 1 0

surf1 polygon plate2
0
0
12
-1 1 0
-1 1 3
1 1 3
1 1 0

lighty20 sphere light_s
0
0
4 0 0 3 0.5

_______________________________________________

Hi Greg,

I found the Fresnel correction on this paper, thanks for the hint:

How does RADIANCE calculate the index of refrecation of plastic?

Thanks,
Rob

···

Am 28.06.2012 01:30, schrieb Greg Ward:

Hi Robert,

There is a Fresnel correction that puts more energy into the specular component at low angles, and even though 45 degrees isn't a very low angle, your differences are in the 4th significant digit. I think this is the source of the discrepancy.

-Greg

From: Robert Franke<robertfranke@gmx.de>
Date: June 27, 2012 2:41:26 PM PDT

Hi,

I try to understand how RADIANCE calculate the radiance values, but the specular value for one reflection isn't clear.
I understand, that the diffuse value is independent of view. On point P_r=(0 1 1) I got from rtrace for the red channel 0.22361, I calculated:

R_r_light=100
distance=2.2360
rho_surf1=0.1
cos(63,43) = light incoming angle

R_r(0,1,1) = R_r_light * (sphere_radius)² / (distance)² * cos (63,43) * rho_surf1 = 0.223606797.

Ok, this value is fine, but what will happen if I look from (0 -1 1) to (0 1 -1) at point (0, 0, 0), I thought this, but it didn't work:

distance=3
rho_mirr=0.3
diff=0.9
spec=0.1
cos(45) = reflected light - observer angle
P_r=0.22361

R_r(0,0,0) = R_r_light * (sphere_radius)² / (distance)² * rho_mirr * diff + spec * P_r * cos(45) = 0.765811388

rtrace = 0.76517

Can somebody explain how the specular component is calculated on my test scene? I do not get it...

Here is my test scene:

void plastic mirr
0
5 .3 .2 .1 0.1 0

void plastic surf1
0
5 .1 .1 .1 0 0

void light lighty20
0
3 100 150 200

mirr polygon plate1
0
12
-1 -1 0
1 -1 0
1 1 0
-1 1 0

surf1 polygon plate2
0
12
-1 1 0
-1 1 3
1 1 3
1 1 0

lighty20 sphere light_s
0
4 0 0 3 0.5

_______________________________________________

_______________________________________________

Hi Rob,

You really need to refer to the code if you want this level of detail. The paper you mention talks about Fresnel reflection, but these formulae are only applied for glass and dielectric. Plastic uses an approximation developed independently by myself and another researcher, Christoph Schlick:

If you look in ray/src/rt/normal.c, you will find it there.

Best,
-Greg

···

From: Robert Franke <robertfranke@gmx.de>
Date: June 29, 2012 4:32:13 AM PDT

Hi Greg,

I found the Fresnel correction on this paper, thanks for the hint:

How does RADIANCE calculate the index of refrecation of plastic?

Thanks,
Rob

Am 28.06.2012 01:30, schrieb Greg Ward:

Hi Robert,

There is a Fresnel correction that puts more energy into the specular component at low angles, and even though 45 degrees isn't a very low angle, your differences are in the 4th significant digit. I think this is the source of the discrepancy.

-Greg

From: Robert Franke<robertfranke@gmx.de>
Date: June 27, 2012 2:41:26 PM PDT

Hi,

I try to understand how RADIANCE calculate the radiance values, but the specular value for one reflection isn't clear.
I understand, that the diffuse value is independent of view. On point P_r=(0 1 1) I got from rtrace for the red channel 0.22361, I calculated:

R_r_light=100
distance=2.2360
rho_surf1=0.1
cos(63,43) = light incoming angle

R_r(0,1,1) = R_r_light * (sphere_radius)² / (distance)² * cos (63,43) * rho_surf1 = 0.223606797.

Ok, this value is fine, but what will happen if I look from (0 -1 1) to (0 1 -1) at point (0, 0, 0), I thought this, but it didn't work:

distance=3
rho_mirr=0.3
diff=0.9
spec=0.1
cos(45) = reflected light - observer angle
P_r=0.22361

R_r(0,0,0) = R_r_light * (sphere_radius)² / (distance)² * rho_mirr * diff + spec * P_r * cos(45) = 0.765811388

rtrace = 0.76517

Can somebody explain how the specular component is calculated on my test scene? I do not get it...

Here is my test scene:

void plastic mirr
0
0
5 .3 .2 .1 0.1 0

void plastic surf1
0
0
5 .1 .1 .1 0 0

void light lighty20
0
0
3 100 150 200

mirr polygon plate1
0
0
12
-1 -1 0
1 -1 0
1 1 0
-1 1 0

surf1 polygon plate2
0
0
12
-1 1 0
-1 1 3
1 1 3
1 1 0

lighty20 sphere light_s
0
0
4 0 0 3 0.5

_______________________________________________