UNPKG

@woosh/meep-engine

Version:

Pure JavaScript game engine. Fully featured and production ready.

18 lines (11 loc) 483 B
import { lerp } from "../../../../core/math/lerp.js"; export function make_sky_rtiw() { // see https://raytracing.github.io/books/RayTracingInOneWeekend.html return (out, out_offset, direction, direction_offset) => { const dir_y = direction[direction_offset + 1]; const t = 0.5 * (dir_y + 1); out[out_offset] = lerp(0.5, 1, t); out[out_offset + 1] = lerp(0.7, 1, t); out[out_offset + 2] = lerp(1, 1, t); } }