From: Mikko Rasa Date: Fri, 8 Oct 2021 06:52:47 +0000 (+0300) Subject: Use image-based lighting in the entire desert pillars scene X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=commitdiff_plain;h=0b766638d9707f1dfcde918637bde51fe7d00af3 Use image-based lighting in the entire desert pillars scene --- diff --git a/demos/desertpillars/data/exported/Ground033.tech b/demos/desertpillars/data/exported/Ground033.tech index 5c34da55..38e3f4ec 100644 --- a/demos/desertpillars/data/exported/Ground033.tech +++ b/demos/desertpillars/data/exported/Ground033.tech @@ -11,4 +11,5 @@ method "" sampler "linear_mip.samp"; }; receive_shadows true; + image_based_lighting true; }; diff --git a/demos/desertpillars/data/exported/Stone.tech b/demos/desertpillars/data/exported/Stone.tech index 999092e3..4faebac9 100644 --- a/demos/desertpillars/data/exported/Stone.tech +++ b/demos/desertpillars/data/exported/Stone.tech @@ -11,6 +11,7 @@ method "" sampler "linear_mip.samp"; }; receive_shadows true; + image_based_lighting true; }; method "shadow" { diff --git a/demos/desertpillars/data/exported/Tiles028.tech b/demos/desertpillars/data/exported/Tiles028.tech index 0c33a7cb..6729b010 100644 --- a/demos/desertpillars/data/exported/Tiles028.tech +++ b/demos/desertpillars/data/exported/Tiles028.tech @@ -11,6 +11,7 @@ method "" sampler "linear_mip.samp"; }; receive_shadows true; + image_based_lighting true; }; method "shadow" { diff --git a/demos/desertpillars/scene.blend b/demos/desertpillars/scene.blend index 8505c292..5d8d43f9 100644 Binary files a/demos/desertpillars/scene.blend and b/demos/desertpillars/scene.blend differ diff --git a/demos/desertpillars/source/desertpillars.cpp b/demos/desertpillars/source/desertpillars.cpp index 5932e569..84583551 100644 --- a/demos/desertpillars/source/desertpillars.cpp +++ b/demos/desertpillars/source/desertpillars.cpp @@ -35,8 +35,16 @@ DesertPillars::DesertPillars(int, char **): window.signal_close.connect(sigc::bind(sigc::mem_fun(this, &DesertPillars::exit), 0)); keyboard.signal_button_press.connect(sigc::bind_return(sigc::mem_fun(this, &DesertPillars::key_press), false)); + env_seq = make_unique(); + env_seq->set_clear_enabled(true); + env_seq->set_debug_name("Environment sequence"); + + global_env = make_unique(32, GL::RGB16F, 2, content, *env_seq); + global_env->set_fixed_position(GL::Vector3(0.0f, 0.0f, 0.0f)); + global_env->set_debug_name("Global environment"); + GL::DirectionalLight &sun = resources.get("Sun.light"); - sky = make_unique(content, sun); + sky = make_unique(*global_env, sun); sky->set_debug_name("Sky"); shadow_seq = make_unique(); @@ -54,9 +62,6 @@ DesertPillars::DesertPillars(int, char **): seq_bld.set_debug_name("Main sequence"); sequence.reset(seq_bld.build(view)); - env_seq = make_unique(); - env_seq->set_clear_enabled(true); - env_seq->set_debug_name("Environment sequence"); step = &env_seq->add_step("", *shadow_map); step->set_lighting(&resources.get("Desert.lightn")); step->set_depth_test(GL::LEQUAL); diff --git a/demos/desertpillars/source/desertpillars.h b/demos/desertpillars/source/desertpillars.h index be8235c7..c6242ad3 100644 --- a/demos/desertpillars/source/desertpillars.h +++ b/demos/desertpillars/source/desertpillars.h @@ -70,6 +70,7 @@ private: std::unique_ptr shadow_map; std::unique_ptr env_seq; std::unique_ptr env_map; + std::unique_ptr global_env; Msp::GL::OrderedScene content; MorphSphere sphere;