Ray Tracing, Apple Metal, Swift Programming, Gpu Rendering, Wwdc 2020.
float(pid.x)/float(row); float v = float(pid.y)/float(column); float3 direction = lowerLeftCorner + u * horizontal + v * vertical; float intensity = normalize(direction).y * 0.5 + 0.5; //5 the mix function is the lerp blending function half4 answer = mix(bottom, top, intensity); //6 writing the