diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-11-06 20:48:33 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-11-07 01:02:02 +0000 |
commit | 2f8d7643d03f39fa848576692264d0fe3a37ed91 (patch) | |
tree | f4578e2ce3020c04a206f9eb0bc02587de5b3d6a /test/test-render.cpp | |
parent | Don't request a specific OpenGL version, just check we get something sufficie... (diff) | |
download | ilt-2f8d7643d03f39fa848576692264d0fe3a37ed91.tar.bz2 ilt-2f8d7643d03f39fa848576692264d0fe3a37ed91.tar.xz ilt-2f8d7643d03f39fa848576692264d0fe3a37ed91.zip |
Reformat with new clang-format
Diffstat (limited to 'test/test-render.cpp')
-rw-r--r-- | test/test-render.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/test-render.cpp b/test/test-render.cpp index 0d384a3..b16f241 100644 --- a/test/test-render.cpp +++ b/test/test-render.cpp @@ -43,16 +43,19 @@ public: train2->bogies.front().setPosition(train2->bogies.front().position() + train2->location.position()); train2->bogies.back().setPosition(train2->bogies.back().position() + train2->location.position()); } + void content(const SceneShader & shader) const override { terrain.render(shader); brush47rvc->render(shader); } + void lights(const SceneShader &) const override { } + void shadows(const ShadowMapper & shadowMapper) const override { @@ -95,6 +98,7 @@ BOOST_AUTO_TEST_CASE(pointlight) { SceneRenderer ss {size, output}; ss.camera.setView({-10, -10, 60}, glm::normalize(glm::vec3 {1, 1, -0.5F})); + class PointLightScene : public TestScene { public: void @@ -103,6 +107,7 @@ BOOST_AUTO_TEST_CASE(pointlight) 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 { @@ -113,6 +118,7 @@ BOOST_AUTO_TEST_CASE(pointlight) } } }; + const PointLightScene scene; ss.render(scene); Texture::save(outImage, "/tmp/pointlight.tga"); @@ -122,6 +128,7 @@ BOOST_AUTO_TEST_CASE(spotlight) { SceneRenderer ss {size, output}; ss.camera.setView({-10, -10, 60}, glm::normalize(glm::vec3 {1, 1, -0.5F})); + class PointLightScene : public TestScene { public: void @@ -130,6 +137,7 @@ BOOST_AUTO_TEST_CASE(spotlight) 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 { @@ -139,6 +147,7 @@ BOOST_AUTO_TEST_CASE(spotlight) shader.spotLight.add({60, 50, 3}, north + east, {1.0, 1.0, 1.0}, 0.0001F, .7F); } }; + const PointLightScene scene; ss.render(scene); Texture::save(outImage, "/tmp/spotlight.tga"); |