Exercise 1: A Missing Lighting Clamp With Two Lights on the Chest — Possible Solution ==================================================================== WHAT WOULD HAPPEN WITHOUT THE CLAMP ------------------------------ This chapter's Step 3 reused Chapter 4's own verified numbers: the chest lid's normal dotted with a light in front gives a positive brightness of approximately 0.6069, while the same normal dotted with a light positioned behind the lid gives a NEGATIVE value of approximately -0.6069. If the lighting code sums each light's contribution and only clamps the final total once at the end (a common, efficient design, as this course's Numerical Methods & Floating-Point Computation material discussed), the light in front would contribute +0.6069 to the running total, but the light behind the chest would contribute -0.6069 - actively SUBTRACTING from the total brightness rather than contributing nothing. THE VISIBLE RESULT ------------------------------ Summing both contributions before any clamp: 0.6069 + (-0.6069) = 0. The chest lid would render as if it were receiving NO light at all - completely black or unlit - even though one of the two lights is genuinely, correctly illuminating it from the front. A player looking at the scene would see the chest's lid go dark specifically because a second light was added somewhere behind it, which is physically backwards: adding a light source should never make a surface appear darker than it would with fewer lights. WHY THIS IS A REAL, PLAUSIBLE BUG RATHER THAN A CONTRIVED ONE ------------------------------ This is exactly the multi-light summing scenario described as the place this bug becomes clearly visible, since with only one light in a test scene, an incidental downstream clamp (for example, when converting a brightness value to an 8-bit color channel) can mask a missing max(0, ...) check without anyone noticing - it's specifically when multiple lights are combined before that final clamp that a light behind an object can meaningfully cancel out a light in front of it. WHY THIS WORKS AS AN ANSWER ------------------------------ The explanation uses this chapter's own specific reused numbers (0.6069 and -0.6069) to compute the exact resulting sum rather than describing the bug only qualitatively, and identifies the precise, physically nonsensical visible symptom (the chest going dark when a second light is added) that would result.