Snell's law of refraction, and Wolff BRDF

Click For Summary

Homework Help Overview

The discussion revolves around the application of Snell's Law and Fresnel equations in the context of writing a shader for the Wolff BRDF, which combines Lambertian diffuse reflection with Fresnel terms. The original poster expresses uncertainty about the mathematical reasoning behind the second Fresnel term used in the shader implementation.

Discussion Character

  • Exploratory, Conceptual clarification, Mathematical reasoning

Approaches and Questions Raised

  • The original poster attempts to derive the cosine of the refracted angle using Snell's Law and trigonometric identities. They question the reasoning behind a specific Fresnel term in the shader code. Other participants provide insights into the implications of light transmission and reflection in the context of the BRDF model.

Discussion Status

Participants are actively engaging with the original poster's questions, providing clarifications and suggesting resources for further reading. There is an acknowledgment of the complexity of the topic, and the discussion is exploring various interpretations of the Fresnel terms without reaching a consensus.

Contextual Notes

The original poster notes their background in art and limited formal education in math and physics, which influences their understanding of the concepts discussed. They express a desire to fill gaps in their knowledge and seek guidance in a supportive environment.

luisbf
Messages
3
Reaction score
0
Hi
I wasn't sure of where to post, since well, I'm an adult, and math/physics weren't a big part of my curriculum, and yet, years later, i thought that continuing to have severe holes in my understanding of math and physics wasn't beneficial, even if i didn't had any direct applications to aqquiring this new knowledge, so, if I'm sorry if i'll be asking stupid things, but i wasn't sure where to post, and i have no one to talk about such things.

My problem is as follows (this is problably basic, but here goes), I'm trying to write a shader for this BRDF (found that seeing things makes understanding easier), the Wolff BRDF, which is basically a Lambertian diffuse, the cosine of the angle between incident (light) vector, and surface normal, but, multiplied by 2 Fresnel terms, one accounting for the amount of reflected light (from the incident light vector), and another second term, that accounts for the scattered light at the surface, and which uses the viewer vector instead.

This paper uses for the first term, the cosine of the angle between the incident (light) vector, and the surface normal, and the absolute IOR of the interior medium, let's say 1.5.
So far so good, let's say, in RSL (shading language similar to C, for RenderMan renderers, such as the GPLv2 http://www.renderpixie.com/" ):
float foo = fresnel( cos(theta) , IOR)
What's puzzling me is how they do the 2nd Fresnel term. They mention they mention the following formula
Code:
float foo = fresnel( 1 / ( sin(theta)/IOR), 1/IOR );

i don't understand this, i mean, i spent some time reading Fresnel equations and Snell's Law of reflection and refraction, and please correct me if I'm wrong, but, according to Snell's law, the ratio of the sine of the incident angle, and of the refracted angle, is equal to the ratio of the IOR of the interior and exterior medium, so

\eta_{1} * sin(\theta_{1}) = \eta_{2} * sin(\theta_{2})

so, to get the sine of theta2:

sin(\theta_{2}) = \eta_{1} * sin(\theta_{1}) / \eta_{2}<br /> = (\eta_{1} / \eta_{2}) * sin(\theta_{1})

but since i have the cosine of theta1, using trigonometric identities then

sin(\theta_{2}) = (\eta_{1}/\eta_{2}) * \sqrt{ 1 - cos(\theta_{1})^2}

and since i wanted the cosine of the transmitted angle to begin with, then

cos(\theta_{2}) = \sqrt{ 1 - ( (\eta_{1}/\eta_{2}) * \sqrt{ 1 - cos(\theta_{1})^2}^2} } = \sqrt{ 1 - (\eta_{1}/\eta_{2})^2 * \sqrt{ 1 - cos(\theta_{1})^2}^2}

the square root and the squaring cancel each other leaving

cos(\theta_{2}) = \sqrt{ 1 - (\eta_{1}/\eta_{2})^2 * (1 - cos(\theta_{1})^2)}

Does this seems correct?
I still don't understand the reasoning for the fresnel( 1/ (sin(\theta_{1})/IOR), 1/IOR) though
This model can be seen in the following paper:
http://www.bmva.org/bmvc/2004/papers/paper_185.pdf"

Sorry if this wasn't the right place to post such questions, perhaps there should be a section for math&physics impaired adults to fix the holes in their knowledge without fear of the ridicule?

Thank you in advance for your time.

P.S.: just reallized that
sin^{-1}( (\eta_{1}/\eta_{2}) * sin(\theta_{1})) = asin( (\eta_{1}/\eta_{2}) * sin(\theta_{1}) )
The raise to -1 power was confusing me, according to wikipedia

In trigonometry, for historical reasons, sin2(x) usually does mean the square of sin(x):

sin^2 x = (\sin x)^2.

However, the expression sin-1(x) does not represent the multiplicative inverse to sin(x):

sin^{-1} x \neq (\sin x)^{-1}.

It denotes the inverse function for sin(x) (actually a partial inverse; see below). To avoid confusion, an inverse trigonometric function is often indicated by the prefix "arc". For instance the inverse sine is typically called the arcsine

Still, if anyone can correct my reasoning, i would apretiate it a lot (already ordered 2 books on algebra, calculus, and 1 on optics, to avoid making a fool of myself, at least often...).
 
Last edited by a moderator:
Physics news on Phys.org
Welcome to PF :smile:

luisbf said:
cos(\theta_{2}) = \sqrt{ 1 - (\eta_{1}/\eta_{2})^2 * (1 - cos(\theta_{1})^2)}

Does this seems correct?
Yes.

I still don't understand the reasoning for the fresnel( 1/ (sin(\theta_{1})/IOR), 1/IOR) though
This model can be seen in the following paper:
http://www.bmva.org/bmvc/2004/papers/paper_185.pdf"

According to that paper, the reason is that a light ray can be transmitted into the object some distance before being reflected. This will modify the Lambertian cosine distribution of reflected intensity, which holds when rays are reflected at the surface. The Fresnel term accounts for the modification of the cosine distribution.

For more details, have you looked at Ref. 9 of that paper:
L.B. Wolff "Diffuse Reflectance Model for Smooth Dielectric Surfaces", J. Optical Society of America A, vol. 11, no. 11, 1994, pp. 2956-2968.

Sorry if this wasn't the right place to post such questions, perhaps there should be a section for math&physics impaired adults to fix the holes in their knowledge without fear of the ridicule?

Well, you seem to understand quite a bit! But to answer your question, yes, there are non-homework areas at PF for questions like this:

For physics questions, choose one of the Physics subforums
https://www.physicsforums.com/forumdisplay.php?f=9

There is also a Programming subforum, if you run into questions about programming code
https://www.physicsforums.com/forumdisplay.php?f=165
 
Last edited by a moderator:
Hi

Thank you very much for your time, that second term was puzzling me - I'm a painter and didn't had much math&physics at school, unfortunately - i blame myself for drawing a lot in the math classes i confess, but if only my teachers had bothered telling me there were practical applications for all that, and had shown me some pictures, of fractals for instance... So, the few i know so far, has been of reading "math for idiots" books in the last 8-10 monthes, and being stubborn as a mule, so my math is full of holes, for the time being.
Back to the topic though, i was re-reading the wikipedia entry, some things aren't very clear, but, what was confusing me in that 2nd Fresnel term, was the \theta_{2}=sin^{-1}((\eta_{1}/\eta_{2})*sin(\theta_{1}))
until i realized it was the same thing - since i wanted the cosine of theta2, and using trigonometric identities i was going to end up reaching the same equation:
cos(\theta_{2})=cos(asin( (\eta_{1}/\eta_{2})*sin(\theta_{1})))
which is
cos(\theta_{2})=\sqrt{1-((\eta_{1}/\eta_{2})*sin(\theta_{1}))^2}
which lead me to the equations in the first post.
I thought that sin^{-1}(\theta_{1}) was raising \theta_{1} to the -1 power, when it's the inverse function, the arcsine (which means back to the "math for idiots" book, and reading about mutliplicative versus compositional inverses)

About that paper, unfortunately i don't have a subscription to Optical Society of America, i think that paper is for subscribers only, and the only 2 papers i found that mentioned the Wolff model were the "Fresnel Correction of the Beckmann Model", by Hossein Ragheb, and Edwin R. Hancock, and "Improved Diffuse Reflection Models for Computer Vision", by Lawrence B. Wolff, Shree K. Nayar, and Michael Oren, so i had to rely on these 2, but thanks for the suggestion, I'm going to try and see if there's a public copy at http://citeseerx.ist.psu.edu/".
About the code, it's just a way to keep myself busy, seeing math in action sort of helps understanding it, and i found RenderMan Shading language to be quite accessible. I'll clean the code, and post it in the programming section, just in case anyone is interested.

Once again, many thanks for taking your time to reply.

Best regards

Luis Fernandes
 
Last edited by a moderator:
You're welcome, and good luck!

Mark

p.s. to see that referenced paper, I recommend going to the library of a local university's physics department, and see if they have it. I'd estimate that a subscription would cost roughly $150 per year, since you'd need to be a member of OSA in order to subscribe. But I'll also warn you, the math is likely to be very detailed, and also using references to more papers that you may be compelled to look up, and those papers would reference others, etc. etc.
 
Hi Mark

Thanks for the suggestion, going to try and check that book/article, i was curious for some time now about Wolff's model, in detail, and the papers i found only referred to it in an somewhat superficial way.
I'll post the renderman shader code as soon as i have it cleaned up, together with some images, and gnuplot graphs, comparing it with the Lambertian diffuse model, in case someone wants to "play" with such things.
Thanks once again.

Best regards

Luis Fernandes
 

Similar threads

  • · Replies 12 ·
Replies
12
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 20 ·
Replies
20
Views
2K
  • · Replies 12 ·
Replies
12
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
Replies
1
Views
1K
  • · Replies 7 ·
Replies
7
Views
2K
Replies
1
Views
1K
  • · Replies 11 ·
Replies
11
Views
1K
Replies
3
Views
1K