Skip to content

Commit

Permalink
arealights: disable Y-flip in the DDS importer.
Browse files Browse the repository at this point in the history
The example was made back when DDS files were loaded without Y flipping,
so when they actually got flipped, it broke the example.
  • Loading branch information
mosra committed Oct 2, 2024
1 parent dd0327e commit a54ab83
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/arealights/AreaLightsExample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include <Corrade/Containers/StringView.h>
#include <Corrade/Containers/StringStl.h>
#include <Corrade/PluginManager/PluginManager.h>
#include <Corrade/Utility/ConfigurationGroup.h>
#include <Corrade/Utility/FormatStl.h>
#include <Corrade/Utility/Resource.h>
#include <Magnum/ImageView.h>
Expand Down Expand Up @@ -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<Trade::AbstractImporter> manager;
Containers::Pointer<Trade::AbstractImporter> 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")))
Expand Down

0 comments on commit a54ab83

Please sign in to comment.