From 71f101c7aff0b14d1cc52dba21ca318bad5dac8f Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sat, 28 Jan 2023 22:54:12 +0200 Subject: [PATCH] Adjust Bassteroids for the lighting changes --- examples/bassteroids/data/main.camera.setup | 1 - examples/bassteroids/data/space.lightn | 1 - examples/bassteroids/data/space.seq | 17 ----------------- examples/bassteroids/data/sun.light | 3 --- examples/bassteroids/data/sun.light.setup | 2 ++ examples/bassteroids/source/bassteroids.cpp | 7 ++++++- examples/bassteroids/source/bassteroids.h | 3 +++ 7 files changed, 11 insertions(+), 23 deletions(-) delete mode 100644 examples/bassteroids/data/space.lightn delete mode 100644 examples/bassteroids/data/space.seq delete mode 100644 examples/bassteroids/data/sun.light create mode 100644 examples/bassteroids/data/sun.light.setup diff --git a/examples/bassteroids/data/main.camera.setup b/examples/bassteroids/data/main.camera.setup index b8020f2..5012d2c 100644 --- a/examples/bassteroids/data/main.camera.setup +++ b/examples/bassteroids/data/main.camera.setup @@ -2,4 +2,3 @@ field_of_view_y 0; size 80 45; near_clip -30; far_clip 30; -sequence_name "space.seq"; diff --git a/examples/bassteroids/data/space.lightn b/examples/bassteroids/data/space.lightn deleted file mode 100644 index a7342bf..0000000 --- a/examples/bassteroids/data/space.lightn +++ /dev/null @@ -1 +0,0 @@ -light "sun.light"; diff --git a/examples/bassteroids/data/space.seq b/examples/bassteroids/data/space.seq deleted file mode 100644 index 730a3fd..0000000 --- a/examples/bassteroids/data/space.seq +++ /dev/null @@ -1,17 +0,0 @@ -hdr true; -clear; -renderable "content"; -step "" "content" -{ - depth_test LEQUAL; - lighting "space.lightn"; -}; -postprocessor -{ - type bloom; -}; -postprocessor -{ - type colorcurve; - srgb; -}; diff --git a/examples/bassteroids/data/sun.light b/examples/bassteroids/data/sun.light deleted file mode 100644 index 822e8da..0000000 --- a/examples/bassteroids/data/sun.light +++ /dev/null @@ -1,3 +0,0 @@ -type directional; -direction 0.1 -0.1 -1.0; -color 2.0 2.0 2.0; diff --git a/examples/bassteroids/data/sun.light.setup b/examples/bassteroids/data/sun.light.setup new file mode 100644 index 0000000..8edd131 --- /dev/null +++ b/examples/bassteroids/data/sun.light.setup @@ -0,0 +1,2 @@ +type DIRECTIONAL; +intensity 2.0; diff --git a/examples/bassteroids/source/bassteroids.cpp b/examples/bassteroids/source/bassteroids.cpp index e443d5e..709b1a1 100644 --- a/examples/bassteroids/source/bassteroids.cpp +++ b/examples/bassteroids/source/bassteroids.cpp @@ -25,7 +25,9 @@ Bassteroids::Bassteroids(int, char **): pf_setup({ .size={ 80, 45 }}), playfield(game_stage.get_root(), pf_setup), cam_entity(game_stage.get_root(), Game::TransformValues()), - camera(cam_entity, resources.get("main.camera.setup")) + camera(cam_entity, resources.get("main.camera.setup")), + sun_entity(game_stage.get_root(), Game::TransformValues()), + sun(sun_entity, resources.get("sun.light.setup")) { game_stage.add_system(); game_stage.add_system(); @@ -36,6 +38,9 @@ Bassteroids::Bassteroids(int, char **): player_input.set_control_scheme_type(GameView::PlayerInput::ONE_LOCAL_PLAYER); + sun_entity->get_transform()->set_rotation(Geometry::Quaternion::rotation( + LinAl::Vector(0.0f, 0.0f, -1.0f), LinAl::Vector(0.1f, -0.1f, -1.0f))); + director.activate_stage(game_stage); } diff --git a/examples/bassteroids/source/bassteroids.h b/examples/bassteroids/source/bassteroids.h index f3eabdd..4e742ca 100644 --- a/examples/bassteroids/source/bassteroids.h +++ b/examples/bassteroids/source/bassteroids.h @@ -2,6 +2,7 @@ #define BASSTEROIDS_H_ #include +#include #include #include #include @@ -28,6 +29,8 @@ private: Msp::Game::Owned cam_entity; Msp::Game::Owned camera; + Msp::Game::Owned sun_entity; + Msp::Game::Owned sun; public: Bassteroids(int, char **); -- 2.45.2