53
edits
Changes
→Presentation
for (unsigned x = 0; x < IMG_RES; ++x) {
int k = x + y * IMG_RES;
float xx xxPoints = (2 * ((x + 0.5) * iwidth) - 1) * viewangle * aspectratio; float yy yyPoints = (1 - 2 * ((y + 0.5) * iheight)) * viewangle; Vec3f raydirrayDirection, rayorigrayOrigin; raydirrayDirection.init(xxxxPoints, yyyyPoints, -1); raydirrayDirection.normalize(); rayorigrayOrigin.init(0); // Begin tracing // trace(rayorigrayOrigin, raydirrayDirection, 0, pixel, sphere, k);
}
}
</code>
This function traces the rays for each pixel of the image , traces it and returns a color.
= Assignment 2 =
[[File:excelgraph2.jpg]]
From this chart we can see the significant drop in run time when we switch from serial to parallel processing in ray tracing using CUDA as we double the resolution from 512. There is still room for improvement which will be implemented, and analyzed in assignment 3.
= Assignment 3 =