Snell's law of refraction, and Wolff BRDF

In summary, the conversation discusses the difficulties of understanding math and physics without proper education, and specifically focuses on the Wolfff BRDF shader. The speaker's main confusion lies in the second Fresnel term, which takes into account the modification of the Lambertian cosine distribution for reflected rays that penetrate into the object before being reflected. The conversation also mentions the possibility of a section for those with limited math and physics knowledge to ask questions without fear of ridicule.
  • #1
luisbf
3
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

[tex]\eta_{1} * sin(\theta_{1}) = \eta_{2} * sin(\theta_{2})[/tex]

so, to get the sine of theta2:

[tex]sin(\theta_{2}) = \eta_{1} * sin(\theta_{1}) / \eta_{2}
= (\eta_{1} / \eta_{2}) * sin(\theta_{1})[/tex]

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

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

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

[tex]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}[/tex]

the square root and the squaring cancel each other leaving

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

Does this seems correct?
I still don't understand the reasoning for the fresnel( [tex]1/ (sin(\theta_{1})/IOR), 1/IOR)[/tex] 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
[tex]sin^{-1}( (\eta_{1}/\eta_{2}) * sin(\theta_{1})) = asin( (\eta_{1}/\eta_{2}) * sin(\theta_{1}) )[/tex]
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):

[tex]sin^2 x = (\sin x)^2.[/tex]

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

[tex]sin^{-1} x \neq (\sin x)^{-1}.[/tex]

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
  • #2
Welcome to PF :smile:

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

Does this seems correct?
Yes.

I still don't understand the reasoning for the fresnel( [tex]1/ (sin(\theta_{1})/IOR), 1/IOR)[/tex] 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:
  • #3
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 [tex]\theta_{2}=sin^{-1}((\eta_{1}/\eta_{2})*sin(\theta_{1}))[/tex]
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:
[tex]cos(\theta_{2})=cos(asin( (\eta_{1}/\eta_{2})*sin(\theta_{1})))[/tex]
which is
[tex]cos(\theta_{2})=\sqrt{1-((\eta_{1}/\eta_{2})*sin(\theta_{1}))^2}[/tex]
which lead me to the equations in the first post.
I thought that [tex]sin^{-1}(\theta_{1})[/tex] was raising [tex]\theta_{1}[/tex] 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 Langauge 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:
  • #4
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.
 
  • #5
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
 

What is Snell's law of refraction?

Snell's law of refraction, also known as the law of refraction, describes the relationship between the angle of incidence and the angle of refraction when a ray of light passes through the boundary between two different mediums, such as air and water.

How is Snell's law of refraction used in science?

Snell's law of refraction is used in a variety of scientific fields, including optics, astronomy, and geophysics, to predict how light will be refracted as it passes through different mediums. It is also used in the design of lenses and other optical instruments.

What is the Wolff BRDF model?

The Wolff BRDF (Bidirectional Reflectance Distribution Function) model is a mathematical model used to describe how light is reflected off of a surface. It takes into account the angle of incidence, the surface roughness, and the properties of the material to predict the amount of light that will be reflected in a certain direction.

How is the Wolff BRDF model used in computer graphics?

The Wolff BRDF model is commonly used in computer graphics to create realistic lighting and shading effects. It is particularly useful for simulating materials with varying levels of roughness, such as wood or metal, and can be used to accurately render reflections and highlights.

What are some limitations of Snell's law of refraction and the Wolff BRDF model?

One limitation of Snell's law of refraction is that it only applies to light passing through transparent materials, and does not take into account other factors such as absorption or scattering. The Wolff BRDF model also has limitations, as it does not account for subsurface scattering, which can be important for certain materials such as skin or wax.

Similar threads

  • Introductory Physics Homework Help
Replies
12
Views
2K
  • Introductory Physics Homework Help
Replies
2
Views
1K
  • Introductory Physics Homework Help
Replies
20
Views
1K
  • Introductory Physics Homework Help
Replies
12
Views
2K
  • Introductory Physics Homework Help
Replies
3
Views
1K
  • Introductory Physics Homework Help
Replies
1
Views
200
  • Introductory Physics Homework Help
Replies
3
Views
841
  • Introductory Physics Homework Help
2
Replies
38
Views
1K
  • Introductory Physics Homework Help
Replies
12
Views
798
  • Introductory Physics Homework Help
Replies
14
Views
328
Back
Top