From a54ab832fa03b78068fcbc1b14013246865dced3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 2 Oct 2024 17:50:01 +0200 Subject: [PATCH] arealights: disable Y-flip in the DDS importer. The example was made back when DDS files were loaded without Y flipping, so when they actually got flipped, it broke the example. --- src/arealights/AreaLightsExample.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/arealights/AreaLightsExample.cpp b/src/arealights/AreaLightsExample.cpp index b5f7d1f0..00ba5ff0 100644 --- a/src/arealights/AreaLightsExample.cpp +++ b/src/arealights/AreaLightsExample.cpp @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -338,10 +339,12 @@ AreaLightsExample::AreaLightsExample(const Arguments& arguments): Platform::Appl _projection = Matrix4::perspectiveProjection(60.0_degf, 4.0f/3.0f, 0.1f, 50.0f); _transformation = Matrix4::rotationX(-90.0_degf)*Matrix4::scaling(Vector3{25.0f}); - /* Load LTC matrix and BRDF textures */ + /* Load LTC matrix and BRDF textures. The shader assumes the data is + Y-down, so disable Y-flipping in the importer. */ PluginManager::Manager manager; Containers::Pointer importer = manager.loadAndInstantiate("DdsImporter"); if(!importer) std::exit(1); + importer->configuration().setValue("assumeYUpZBackward", true); const Utility::Resource rs{"arealights-data"}; if(!importer->openData(rs.getRaw("ltc_amp.dds")))