Added a few clearing-up code tweaks

This commit is contained in:
Martin committed 2024-11-14 12:17:09 +01:00
1 parent c8e17dfe4f
commit 0bdb7195de
3 files changed
+3 -13

No files matched your search

+3 -2
View File
@@ -65,9 +65,10 @@ __global__ void renderKernel(unsigned char* framebuffer, Sphere* spheres, int nu
Vec3 rayOrigin(0, 0, 0);
Vec3 colCum(0, 0, 0);
double spp = static_cast<double>(SAMPLES_PER_PIXEL);
for (int sample = 0; sample < SAMPLES_PER_PIXEL; sample++) {
double u = (x + (sample / static_cast<double>(SAMPLES_PER_PIXEL)) - WIDTH / 2.0) / WIDTH;
double v = (y + (sample / static_cast<double>(SAMPLES_PER_PIXEL)) - HEIGHT / 2.0) / HEIGHT;
double u = (x + (sample / spp) - WIDTH / 2.0) / WIDTH;
double v = (y + (sample / spp) - HEIGHT / 2.0) / HEIGHT;
Vec3 rayDir(u, v, 1.0);
rayDir = rayDir.normalize();
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.