Skip to content

Instantly share code, notes, and snippets.

@markp-gc
Last active December 2, 2021 17:10
Ray gen loop (Vertex)
using Vec = light::Vector;
unsigned k = 0;
for (unsigned r = startRow; r < endRow; ++r) {
for (unsigned c = startCol; c < endCol; ++c) {
const Vec cam = light::pixelToRay(c, r, imageWidth, imageHeight);
rays[k] = cam.x + (float)(*antiAliasScale * rng());
rays[k + 1] = cam.y + (float)(*antiAliasScale * rng());
k += 2;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment