Snell's law of refraction, and Wolff BRDF

AI Thread Summary
The discussion revolves around understanding the Wolff BRDF model and its application in shader programming, particularly focusing on the Fresnel terms involved in light reflection and refraction. The user seeks clarity on the second Fresnel term's formula, which incorporates Snell's Law and the index of refraction (IOR) to account for light transmission into a surface before reflection. They express confusion over the mathematical representation and the inverse sine function, realizing the need for a deeper grasp of trigonometric identities. Additional resources, including academic papers and programming forums, are suggested for further exploration and understanding. The user plans to share their shader code and visual comparisons to enhance community learning.
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 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:
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
 
I multiplied the values first without the error limit. Got 19.38. rounded it off to 2 significant figures since the given data has 2 significant figures. So = 19. For error I used the above formula. It comes out about 1.48. Now my question is. Should I write the answer as 19±1.5 (rounding 1.48 to 2 significant figures) OR should I write it as 19±1. So in short, should the error have same number of significant figures as the mean value or should it have the same number of decimal places as...
Thread 'A cylinder connected to a hanging mass'
Let's declare that for the cylinder, mass = M = 10 kg Radius = R = 4 m For the wall and the floor, Friction coeff = ##\mu## = 0.5 For the hanging mass, mass = m = 11 kg First, we divide the force according to their respective plane (x and y thing, correct me if I'm wrong) and according to which, cylinder or the hanging mass, they're working on. Force on the hanging mass $$mg - T = ma$$ Force(Cylinder) on y $$N_f + f_w - Mg = 0$$ Force(Cylinder) on x $$T + f_f - N_w = Ma$$ There's also...
Back
Top