Part 1 Beginning Groovy

Groovy brings you the best of both worlds: a flexible, highly productive, agile, dynamic language that runs on the rich framework of the Java Platform. Groovy preserves the Java semantics and extends the JDK to give you true dynamic language capabilities. Programming Groovy 2 will help you, the experienced Java developer, lea

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Area Lights and Soft Shadows

The Ray Tracer Challenge — by Jamis Buck (98 / 108)

👈 Chapter 17 Next Steps | TOC | Spotlights 👉

Your ray tracer currently implements point lights, which exist at a single point and have no size. These lights cast sharp, crisp shadows with perfectly defined outlines. But in the physical world, a point light doesn’t actually exist. Light sources have dimension, and the shadows they cast tend to be fuzzy around the edges as a result.

Consider the illustration, which compares shadows cast by a point light (on the left), with shadows cast by an area light (on the right).

images/next/arealight-compare.png

Those blurred shadows don’t come cheap. Recall from Chapter 8, Shadows, that your current shadow test casts a single ray from the point of intersection to the light source. This results in a boolean “yes/no” result, answering the question of whether the point is in shadow. For an area light, you must cast multiple shadow rays, and the answer is no longer “yes” or “no,” but an intensity value telling you how much shadow exists at that point.

To implement an area light, follow these steps:

Light sources are of many types, though. Read on for another one.

👈 Chapter 17 Next Steps | TOC | Spotlights 👉

Add a comment

Related posts:

Persistence Overcomes Resistance

Growing up in the public eye (with one of the most recognizable last names in the world) didn’t stop Chelsea Clinton from pursuing a career as a global ambassador for her family’s foundation and…

Is Dak For Real?

Dallas Cowboys star quarterback Dak Prescott had by far his best game of his young career last Sun. against the New York Giants. The third-year quarterback went 25 of 32 for 405 yards, four…

What we learned as technical partner on largest gender study

The much-awaited Global Media Monitoring Project (GMMP) 2020 report is finally out and the picture is not all that rosy for gender equality in the media. There are specks of hope, but the landscape…