aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsotech117 <michael_foiani@brown.edu>2023-12-13 02:49:03 -0500
committersotech117 <michael_foiani@brown.edu>2023-12-13 02:49:03 -0500
commit256a50ddd591223cb2cab00cc4c2be62993077da (patch)
treeb1f0bebbdecb0c72d21eeb96876337235a5df135 /src
parent87e614254bc0b1ad0f2ac28a5092c97caab09d7a (diff)
experiment with scene files
Diffstat (limited to 'src')
-rw-r--r--src/accelerate/myqtconcurrent.cpp2
-rw-r--r--src/illuminate/illuminate.cpp6
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