From: Mikko Rasa Date: Sat, 28 Jan 2023 20:54:12 +0000 (+0200) Subject: Adjust Bassteroids for the lighting changes X-Git-Url: https://git.tdb.fi/?a=commitdiff_plain;h=71f101c7aff0b14d1cc52dba21ca318bad5dac8f;p=libs%2Fgame.git Adjust Bassteroids for the lighting changes --- 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 **);