diff options
author | sotech117 <michael_foiani@brown.edu> | 2023-12-13 02:49:03 -0500 |
---|---|---|
committer | sotech117 <michael_foiani@brown.edu> | 2023-12-13 02:49:03 -0500 |
commit | 256a50ddd591223cb2cab00cc4c2be62993077da (patch) | |
tree | b1f0bebbdecb0c72d21eeb96876337235a5df135 /src | |
parent | 87e614254bc0b1ad0f2ac28a5092c97caab09d7a (diff) |
experiment with scene files
Diffstat (limited to 'src')
-rw-r--r-- | src/accelerate/myqtconcurrent.cpp | 2 | ||||
-rw-r--r-- | src/illuminate/illuminate.cpp | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/accelerate/myqtconcurrent.cpp b/src/accelerate/myqtconcurrent.cpp index 08248f4..4d0cb1e 100644 --- a/src/accelerate/myqtconcurrent.cpp +++ b/src/accelerate/myqtconcurrent.cpp @@ -52,7 +52,7 @@ void RayTracer::renderParallel(RGBA *imageData, const RayTraceScene &scene) float z = (imageDepth - scene.depth()/2.f) * viewplaneDepth / scene.depth(); glm::vec4 pWorld = Vec4Ops::transformPoint4(glm::vec4(0.f), camera.getViewMatrix(), camera.getTranslationVector()); - glm::vec4 dWorld = Vec4Ops::transformDir4(glm::vec4(x, y, z, -1.0), camera.getViewMatrix()); + glm::vec4 dWorld = glm::normalize(Vec4Ops::transformDir4(glm::vec4(x, y, z, -1.0), camera.getViewMatrix())); pixelRoutineArgs args{ pWorld, diff --git a/src/illuminate/illuminate.cpp b/src/illuminate/illuminate.cpp index 641f06d..a651924 100644 --- a/src/illuminate/illuminate.cpp +++ b/src/illuminate/illuminate.cpp @@ -87,10 +87,10 @@ glm::vec4 RayTracer::illuminatePixel( } } - // auto incidentDir = -directionToCamera; + auto incidentDir = -directionToCamera; // recursive raytracing for the reflection and refraction (see reflect.cpp) - // illumination += refract(intersectionWorld, normalWorld, incidentDir, shape, scene, depth + 1); - // illumination += reflect(intersectionWorld, normalWorld, incidentDir, shape, scene, depth + 1); + illumination += refract(intersectionWorld, normalWorld, incidentDir, shape, scene, depth + 1); + illumination += reflect(intersectionWorld, normalWorld, incidentDir, shape, scene, depth + 1); return illumination; }
\ No newline at end of file |