Skip to content
This repository was archived by the owner on Dec 12, 2020. It is now read-only.

Commit 4362bf8

Browse files
trying render of scene2 to test shading
1 parent 08b883a commit 4362bf8

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

1.69 MB
Binary file not shown.

Assignments/Ray-Tracing/src/RayTracing.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ int main()
3636

3737
// ---------------------------------------------------------------------------------------------
3838
std::cout << "Loading Scene....";
39-
Scene scene("assets/scene1.txt");
39+
Scene scene("assets/scene2.txt");
4040
std::cout << " COMPLETE!" << std::endl;
4141

4242
scene.Display();

Assignments/Ray-Tracing/src/Scene.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ void Scene::GenerateScene()
171171
}
172172

173173
m_Img.normalize(0, 255);
174-
m_Img.save("render.bmp", true);
174+
m_Img.save("render2.bmp", true);
175175
}
176176

177177
Scene::IntersectingObject Scene::FindNearestIntersectingObject(glm::vec3 ray_dir)
@@ -212,7 +212,7 @@ Scene::IntersectingObject Scene::FindNearestIntersectingObject(glm::vec3 ray_dir
212212
bool Scene::IsLightObstructed(Light* light, IntersectingObject* target)
213213
{
214214
glm::vec3 lightRay = glm::normalize(light->GetPosition() - target->m_Point);
215-
glm::vec3 lightRayWithBias = target->m_Point + LIGHT_BIAS * lightRay;
215+
glm::vec3 lightRayWithBias = (LIGHT_BIAS * lightRay) + target->m_Point;
216216

217217
float distance;
218218
glm::vec3 intersectpoint;

0 commit comments

Comments
 (0)