Last active
December 2, 2021 17:10
Ray gen loop (Vertex)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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