From b8401062e1d3f5e6554ab7fd9b983ea63cfb05c5 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Wed, 10 Jan 2024 19:04:30 +0000 Subject: Initial commit with working light instancing --- test/test-assetFactory.cpp | 6 +++--- test/test-render.cpp | 29 ----------------------------- 2 files changed, 3 insertions(+), 32 deletions(-) (limited to 'test') diff --git a/test/test-assetFactory.cpp b/test/test-assetFactory.cpp index 91a5321..bc93729 100644 --- a/test/test-assetFactory.cpp +++ b/test/test-assetFactory.cpp @@ -138,9 +138,9 @@ BOOST_AUTO_TEST_CASE(lights, *boost::unit_test::timeout(5)) BOOST_REQUIRE(rlight_f); auto light1 = std::make_shared(rlight_f, Location {{0, 0, 0}, {0, 0, 0}}); - auto light2 = std::make_shared(rlight_f, Location {{-4000, 0, 0}, {0, -1, 0}}); - auto light3 = std::make_shared(rlight_f, Location {{-4000, -4000, 0}, {0, -3, 0}}); - auto light4 = std::make_shared(rlight_f, Location {{3000, 4600, 0}, {0, 1, 0}}); + auto light2 = std::make_shared(rlight_f, Location {{-4000, 0, 0}, {0, 2, 0}}); + auto light3 = std::make_shared(rlight_f, Location {{-4000, -4000, 0}, {0, 1, 0}}); + auto light4 = std::make_shared(rlight_f, Location {{3000, 4600, 0}, {0, 3, 0}}); objects.objects.push_back(rlight_f); // yes I'm hacking some floor to light up as though its a bush diff --git a/test/test-render.cpp b/test/test-render.cpp index 66b4d46..47d146c 100644 --- a/test/test-render.cpp +++ b/test/test-render.cpp @@ -188,33 +188,4 @@ BOOST_AUTO_TEST_CASE(pointlight) Texture::save(outImage, "/tmp/pointlight.tga"); } -BOOST_AUTO_TEST_CASE(spotlight) -{ - SceneRenderer ss {size, output}; - ss.camera.setView({-10000, -10000, 60000}, glm::normalize(glm::vec3 {1, 1, -0.5F})); - - class PointLightScene : public TestScene { - public: - void - environment(const SceneShader &, const SceneRenderer & r) const override - { - r.setAmbientLight({0.2F, 0.2F, 0.2F}); - r.setDirectionalLight({0.2F, 0.2F, 0.2F}, west + down, *this); - } - - void - lights(const SceneShader & shader) const override - { - shader.spotLight.add({50000, 50000, 15000}, down, {1.0, 1.0, 1.0}, 0.01F, 1); - shader.spotLight.add({51000, 59500, 1000}, north, {1.0, 1.0, 1.0}, 0.001F, .5); - shader.spotLight.add({53000, 59500, 1000}, north, {1.0, 1.0, 1.0}, 0.001F, .5); - shader.spotLight.add({60000, 50000, 3000}, north + east, {1.0, 1.0, 1.0}, 0.0001F, .7F); - } - }; - - const PointLightScene scene; - ss.render(scene); - Texture::save(outImage, "/tmp/spotlight.tga"); -} - BOOST_AUTO_TEST_SUITE_END(); -- cgit v1.2.3