raytracing.github.io icon indicating copy to clipboard operation
raytracing.github.io copied to clipboard

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

Open bc-nine opened this issue 4 years ago • 6 comments

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.

bc-nine avatar Jul 11 '21 20:07 bc-nine

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

trevordblack avatar Jul 11 '21 21:07 trevordblack

Review during the final v4.0.0 progression audit.

hollasch avatar Oct 20 '21 23:10 hollasch

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?

rogerallen avatar Apr 20 '22 17:04 rogerallen

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

trevordblack avatar Apr 20 '22 17:04 trevordblack

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. 😄

rogerallen avatar Apr 20 '22 20:04 rogerallen

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 $$

rightbrace avatar Oct 27 '23 05:10 rightbrace

@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 avatar Mar 10 '24 21:03 hollasch

Done.

hollasch avatar Mar 20 '24 03:03 hollasch