Raytracer returns hit

This commit is contained in:
Ben Kyd
2019-08-06 00:33:12 +01:00
parent 2ec847bd1c
commit cf142ff5be
7 changed files with 54 additions and 10 deletions

View File

@@ -47,14 +47,14 @@ void ProgressiveRenderer::Render() {
Ray ray = m_scene->camera->CastRay(x, y);
float t, i;
bool didhit = TraceRay(ray, m_scene, t, i);
float t;
Primative* hit = nullptr;
bool didhit = TraceRay(ray, m_scene, t, hit);
if (!didhit) {
m_interface->SetPixelSafe(x, y, 0x000000);
continue;
}
Primative* hit = m_scene->objects[i];
glm::vec3 hitPoint = ray.origin + ray.direction * t;