diff --git a/projects/saf_r/src/main.cpp b/projects/saf_r/src/main.cpp index f84fcd0ad25cdf6bd07ac0423fb6b392ef5dfadf..45da71828ea32e321dbce4a05d5dc4cae0a1b3f0 100644 --- a/projects/saf_r/src/main.cpp +++ b/projects/saf_r/src/main.cpp @@ -101,7 +101,7 @@ int main(int argc, const char** argv) { lights.push_back(safrScene::Light(glm::vec3(30, 20, 30), 1.7)); //create the raytracer image for rendering safrScene scene; - vkcv::asset::TextureData texData = scene.render(spheres, lights); + safrScene::TextureData texData = scene.render(spheres, lights); vkcv::Image texture = core.createImage(vk::Format::eR8G8B8A8Unorm, texData.width, texData.height); texture.fill(texData.data.data()); diff --git a/projects/saf_r/src/safrScene.cpp b/projects/saf_r/src/safrScene.cpp index 72d3072b3df4b1676302fddcefd4d2a4fc698656..aacf879a75245301792f5e72d733aacf41ba01fc 100644 --- a/projects/saf_r/src/safrScene.cpp +++ b/projects/saf_r/src/safrScene.cpp @@ -56,7 +56,7 @@ glm::vec3 safrScene::castRay(const glm::vec3& orig, const glm::vec3& dir, const glm::vec3(1., 1., 1.) * specular_light_intensity * material.albedo[1] + reflect_color * material.albedo[2]; } -vkcv::asset::TextureData safrScene::render(const std::vector<safrScene::Sphere>& spheres, const std::vector<safrScene::Light>& lights) { +safrScene::TextureData safrScene::render(const std::vector<safrScene::Sphere>& spheres, const std::vector<safrScene::Light>& lights) { //constants for the image data const int width = 800; const int height = 600; @@ -86,7 +86,7 @@ vkcv::asset::TextureData safrScene::render(const std::vector<safrScene::Sphere>& data.push_back(static_cast<uint8_t>(255.f)); } - vkcv::asset::TextureData textureData; + safrScene::TextureData textureData; textureData.width = width; textureData.height = height; textureData.componentCount = 4; diff --git a/projects/saf_r/src/safrScene.hpp b/projects/saf_r/src/safrScene.hpp index b7cfa24bb980f259e39f00119fb7694e37d7c689..fa1f9dd4462ed811c86e7929c0a4f8b1e1ffa603 100644 --- a/projects/saf_r/src/safrScene.hpp +++ b/projects/saf_r/src/safrScene.hpp @@ -13,6 +13,17 @@ class safrScene { public: + + /** + * WORKAROUND + * moved the texture data struct from the old asset loader version, because it is necessary for our rendering for now + */ + struct TextureData { + int width; + int height; + int componentCount; + std::vector<char*> data; + }; /* * Light struct with a position and intensity of the light source */ @@ -68,7 +79,7 @@ public: * @param vector: all light sources in the scene * @return TextureData: texture data for the buffers */ - vkcv::asset::TextureData render(const std::vector<Sphere>& spheres, const std::vector<Light>& lights); + TextureData render(const std::vector<Sphere>& spheres, const std::vector<Light>& lights); private: /*