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

Book 1 Section 10.3 Dielectric Sphere In Images Appears Identical Despite Total Internal Reflection Changes #900

Closed
bc-nine opened this issue Jul 11, 2021 · 8 comments

Comments

@bc-nine
Copy link

bc-nine commented Jul 11, 2021

An image of 2 glass spheres is presented immediately prior to Section 10.3, and then in Section 10.3, Total Internal Reflection, it starts off by saying:

That doesn't look right.

and then a new image is presented, which (randomly) changes the center sphere to blue and removes the fuzz on the right sphere.

The presentation flows like, "look at this image, ok it doesn't look right, then ok here's a new thing to consider (total internal reflection), and now look at the new image."

But that doesn't appear to be what was intended. Instead, we're introduced to total internal reflection, which doesn't even seem to appear in either image (as the left sphere appears the same in both images). The obvious thing to look for in the second image is some kind of improvement in the left sphere, after the discussion of TIR, but instead there's just those random 2 unrelated changes mentioned above.

The first image is captioned with "Glass sphere that always refracts", while the second says "Glass sphere that sometimes refracts", and yet the left sphere in both images appears identical. I don't understand what the author intended to convey here.

@trevordblack
Copy link
Collaborator

If I understand your issue, this was fixed in the dev-major branch? That change is taking quite a while to land.

@hollasch hollasch added this to the v4.0.0-rel milestone Oct 20, 2021
@hollasch
Copy link
Collaborator

Review during the final v4.0.0 progression audit.

@rogerallen
Copy link

Going through this recently, I had the same complaint as the OP and I don't see that this was updated in dev-major. I think these are the two images in question:

before: https://github.com/RayTracing/raytracing.github.io/blob/dev-major/images/img-1.14-glass-always-refract.png
after: https://github.com/RayTracing/raytracing.github.io/blob/dev-major/images/img-1.15-glass-sometimes-refract.png

To my eye, the only difference is that the middle sphere changed to diffuse blue. The left sphere looks exactly the same.

Turning on/off this feature in my own testing seems to change a total of 3 pixels by an LSB. Perhaps a note saying this isn't expected to change the image might be warranted?

@trevordblack
Copy link
Collaborator

To be more exact,

We'll be going through and updating all of the images and the associated text in the books as the penultimate step in the v4 release.

See #778

We'll take extra caution for this specific image. Up to and including rewriting the code if we think that we need to make the visual difference even more noticable/obvious.

Although so many subtle things have changed in the last two years that we'll be taking extra caution everywhere

@rogerallen
Copy link

Thank you for the quick reply & for clarifying. I will note that I'm struggling to create an image with noticable total internal reflection. Hope you have better luck than me. 😄

@trevordblack trevordblack modified the milestones: v4.0.0-rel, v4.0.0 Apr 24, 2022
@trevordblack trevordblack modified the milestones: v4.0.0, v4.0.0-book1 Jun 19, 2023
@trevordblack trevordblack modified the milestones: v4.0.0-alpha, v4.0.0 Jul 30, 2023
@hollasch hollasch modified the milestones: v4.0.0, v4.0.0-alpha.2 Aug 23, 2023
@rightbrace
Copy link

I ran into the same issue - implementing the check had no effect on the image - in fact, that code path was never touched.

I believe that the reason that the difference is hard to see is because there is no difference. A ray cast into a sphere with an IOR greater than the surroundings will never exhibit total internal reflection on the way out, so I think it is a mistake to write that there's a difference between the two images.

Math is not my strong suit, but here's a diagram showing this. Note that the sphere has radius 1, the IOR of the surroundings is assumed to be 1, and $0\le\theta_1\le90\degree$:
Adobe_Scan_Oct _11_2023_1_2

$$ \theta_3 = \sin^{-1}\big(\eta\frac{\sin\theta_1}{\eta}\big) = \theta_1 $$

@hollasch hollasch assigned hollasch and unassigned trevordblack Mar 10, 2024
@hollasch
Copy link
Collaborator

@rightbrace — very nice illustration! Yes, working through this myself, I'm also convinced that you cannot observe total internal reflection in a sphere of IOR > 1 when looking from the outside. Other geometries could show this, for example a solid box, but we don't model those. Hmmm, we could show this with a cube, but we haven't defined quadrilaterals yet. (Actually, we could illustrate this with a single refracting quad.)

So, what to do? I think the easiest way would be to show renders of air bubbles inside a water medium (with a flipped index of refraction). That should allow us to show a sphere where mostly direct rays refract, and glancing rays reflect. I'll see what I can conjure up.

Thank you again for the great follow-up!

hollasch added a commit that referenced this issue Mar 10, 2024
With a sphere of index of refraction greater than the surrounding
medium, there is no incoming ray that can be chosen to show total
internal reflection. An incoming ray will be bent to a smaller angle
relative to the surface normal, and then bent back to the original angle
on exit.

To illustrate total reflection, this change renders a bubble of air
inside water. Glancing rays are then reflected off the surface instead
of refracted.

In the service of this change, I've also moved the center sphere back
a bit from the left and right spheres so you can see the affected side
more clearly. This will invalidate all of the other three-sphere images,
which will be fixed up in #1358 (Alpha.2 milestone verify Book 1
progression).

Resolves #900
hollasch added a commit that referenced this issue Mar 20, 2024
With a sphere of index of refraction greater than the surrounding
medium, there is no incoming ray that can be chosen to show total
internal reflection. An incoming ray will be bent to a smaller angle
relative to the surface normal, and then bent back to the original angle
on exit.

To illustrate total reflection, this change renders a bubble of air
inside water. Glancing rays are then reflected off the surface instead
of refracted.

In the service of this change, I've also moved the center sphere back
a bit from the left and right spheres so you can see the affected side
more clearly. This will invalidate all of the other three-sphere images,
which will be fixed up in #1358 (Alpha.2 milestone verify Book 1
progression).

Resolves #900
@hollasch
Copy link
Collaborator

Done.

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