RAYTRACING git status
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user