Skip to content

Commit 491cadb

Browse files
committed
Add clarifying text for background gradient image
Resolves #306
1 parent 5c3d530 commit 491cadb

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

books/RayTracingInOneWeekend.html

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -456,11 +456,14 @@
456456
</div>
457457

458458
<div class='together'>
459-
The `ray_color(ray)` function linearly blends white and blue depending on the up/downess of the $y$
460-
coordinate. I first made it a unit vector so $-1.0 < y < 1.0$. I then did a standard graphics trick
461-
of scaling that to $0.0 ≤ t ≤ 1.0$. When $t = 1.0$ I want blue. When $t = 0.0$ I want white. In
462-
between, I want a blend. This forms a “linear blend”, or “linear interpolation”, or “lerp” for
463-
short, between two things. A lerp is always of the form
459+
The `ray_color(ray)` function linearly blends white and blue depending on the height of the $y$
460+
coordinate _after_ scaling the ray direction to unit length (so $-1.0 < y < 1.0$). Because we're
461+
looking at the $y$ height after normalizing the vector, you'll notice a horizontal gradient to the
462+
color in addition to the vertical gradient.
463+
464+
I then did a standard graphics trick of scaling that to $0.0 ≤ t ≤ 1.0$. When $t = 1.0$ I want blue.
465+
When $t = 0.0$ I want white. In between, I want a blend. This forms a “linear blend”, or “linear
466+
interpolation”, or “lerp” for short, between two things. A lerp is always of the form
464467

465468
$$ \text{blendedValue} = (1-t)\cdot\text{startValue} + t\cdot\text{endValue}, $$
466469

0 commit comments

Comments
 (0)