Ray Tracing, Apple Metal, Swift Programming, Gpu Rendering, Wwdc 2020.
0..<column { let color = float3(Float(i)/Float(row), Float(j)/Float(column), 0.5) let r = Int(256*color.x) let g = Int(256*color.y) let b = Int(256*color.z) out.append(“\(r) \(g) \(b) \n”) } } do { try out.write(to: filename, atomically: true, encoding: String.Encoding.utf8) } catch { // failed to