RAYTRACING git status

This commit is contained in:
Ben Kyd
2019-07-30 01:46:06 +01:00
parent 70e406517b
commit 71e1d5d713
2 changed files with 12 additions and 3 deletions

View File

@@ -4,8 +4,10 @@
#include "../pixel.hpp"
#include "../display/displayinterface.hpp"
#include "../definitions/primatives/primative.hpp"
#include "../definitions/camera.hpp"
#include "../definitions/scene.hpp"
#include "../definitions/ray.hpp"
ProgressiveRenderer::ProgressiveRenderer() {
@@ -31,7 +33,14 @@ void ProgressiveRenderer::Render() {
for (int x = 0; x < m_scene->w; x++)
for (int y = 0; y < m_scene->h; y++) {
Ray ray = GeneratePrimaryRay(x, y, m_scene);
for (int i = 0; i < m_scene->objects.size(); i++) {
float t = 0;
if (m_scene->objects[i]->DoesIntersect(ray, t)) {
m_interface->SetPixelSafe(x, y, rgb888(0, 255, 0));
}
}
}
// Swap framebuffers