Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TheRestOfYourLife: Light Scattering, Where did you get that equation? #415

Open
iaomw opened this issue Mar 28, 2020 · 4 comments
Open

TheRestOfYourLife: Light Scattering, Where did you get that equation? #415

iaomw opened this issue Mar 28, 2020 · 4 comments

Comments

@iaomw
Copy link

iaomw commented Mar 28, 2020

image
Hi, Why does the sin using the same theta as cos? What's the physical meaning? I never seen any sphere area integral like. After alot google search, I didn't find this equation from anywhere.

@trevordblack
Copy link
Collaborator

Problems with clarity in Light Scattering are well known, see #277

My understanding of your issue is
Why is sin and cos both using the same theta?

The integration is over the half-sphere above the plane.

So theta from 0 to pi/2
And phi from 0 to 2pi

It's not entirely clear what's happening in that paragraph, but the point is to normalize the PDF to 1.

We know that for a lambertian, the PDF should scale with cos(theta). So, we integrate over the half-sphere (scaled with cos(theta)), to determine the are over the surface.

Once we find this (pi). We then scale the PDF by this factor (pi).

The cos(theta) * sin(theta) is because integrating over spherical polar coordinates means

dA = sin(theta) dtheta dpi

So

Integral integral cos(theta) dA

Or

Integral integral cos(theta) sin(theta) dtheta dphi

@iaomw
Copy link
Author

iaomw commented Mar 28, 2020

I checked the previous scatter function for lambertian. It's pointing to somewhere in the unit sphere over the hit point. That's not the full range of cos(theta). If we change to half-sphere, I can imagine it becoming something proportional to cos(theta), but not convinced. Otherwise, maybe it's still not the full rang of cos(theta) due to total reflection when theta become too large.

If cos(theta) is PDF, then the integral of it is the area of PDF. I was thinking about the area of hemisphere, that's why it's misleading for me. Now, it make sense.

if PDF = const * cos(theta)
Area of PDF = const * PI = 1.0
then, const = 1.0/PI

@hollasch hollasch added this to the Future milestone Mar 28, 2020
@trevordblack trevordblack modified the milestones: Future, v3.3.0 Jun 25, 2020
@hollasch hollasch modified the milestones: v3.3.0, Backlog, v4.0.0 Oct 12, 2020
@trevordblack
Copy link
Collaborator

The third book has been largely rewritten, and changes reside in branch dev-major. I believe that the confusion here has been resolved in changes made, but I'll refer back to this when we do a final validation pass over book 3 on release (see #863)

@dimitry-ishenko
Copy link
Contributor

dimitry-ishenko commented Apr 25, 2024

Hi, Why does the sin using the same theta as cos? What's the physical meaning? I never seen any sphere area integral like. After alot google search, I didn't find this equation from anywhere.

@iaomw in #1537 you can find a brief explanation where the sine of theta came from.

@hollasch hollasch modified the milestones: v4.0.0-release, Backlog, v4.0.1 Jul 26, 2024
@hollasch hollasch modified the milestones: v4.0.1, Backlog Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants