Ray Tracing, Apple Metal, Swift Programming, Gpu Rendering, Wwdc 2020.
+ 1.0) //3 applying lerp return (1.0 — t) * float3(0.34,0.9,1.0) + t * float3(0.29,0.58,0.2) } Going through the code: Get the unit vector of the direction of the ray, we will use the y direction to move vertically. The range will be between -1.0 and 1.0. The intensity needs to shifted and scaled