From a0cd7a3709ddc47e96b5ffa08efe73d0c14f958b Mon Sep 17 00:00:00 2001 From: TheRedShip Date: Mon, 6 Jan 2025 10:54:19 +0100 Subject: [PATCH] * | Cleaning --- scenes/fox.rt | 2 +- srcs/RT.cpp | 5 ++++- srcs/class/Scene.cpp | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/scenes/fox.rt b/scenes/fox.rt index 3709ac0..eddeeb1 100644 --- a/scenes/fox.rt +++ b/scenes/fox.rt @@ -4,7 +4,7 @@ MAT 255 255 255 5.0 0.0 0.0 //white light MAT 040 150 080 0.0 0.0 0.0 //green MAT 040 080 150 0.0 0.0 0.0 //blue -MAT 255 255 255 0.0 1.0 0.15 //white +MAT 255 255 255 0.0 0.0 0 //white sp 40 100 100 50 0 diff --git a/srcs/RT.cpp b/srcs/RT.cpp index e89e224..cd7d90f 100644 --- a/srcs/RT.cpp +++ b/srcs/RT.cpp @@ -39,7 +39,10 @@ int main(int argc, char **argv) const std::vector &object_data = scene.getObjectData(); const std::vector &material_data = scene.getMaterialData(); - std::cout << "Sending " << object_data.size() << " objects for "<< object_data.size() * sizeof(GPUObject) << " / " << max_gpu_size << " bytes" << std::endl; + std::cout << "Sending " << object_data.size() << " objects for " << \ + object_data.size() * sizeof(GPUObject) + material_data.size() * sizeof(GPUMaterial) \ + << " / " << max_gpu_size << " bytes" << std::endl; + while (!window.shouldClose()) { diff --git a/srcs/class/Scene.cpp b/srcs/class/Scene.cpp index 6feb349..cfe5488 100644 --- a/srcs/class/Scene.cpp +++ b/srcs/class/Scene.cpp @@ -59,6 +59,7 @@ void Scene::addObject(Object *object) void Scene::addMaterial(Material *material) { _materials.push_back(material); + this->updateGPUData(); } void Scene::updateGPUData()