Transparency and Refraction
Refraction describes how light bends when it passes from one transparent medium to another. With this added to your ray tracer, you’ll be able to render pretty convincing glass, water, and other transparent materials. The following figure is one example, showing how a glass sphere distorts the image of the scene behind it.
Refraction is governed by a property called the refractive index (or index of refraction). It’s a number that determines the degree to which light will bend when entering or exiting the material, compared to other materials. The larger the number, the more strongly light will bend when encountering ...
Get The Ray Tracer Challenge now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.