Skip to content

Commit 5ef1176

Browse files
authored
Load ktx2 LUT images with sRGB off. (#21432)
# Objective - Fixes #21425. - Prior to #19408, we were loading the LUTs with sRGB off. #19408 accidentally did not maintain this behavior. ## Solution - Specify the settings for the LUTs to disable sRGB. - Also make the LUTs only accessible in the render world. ## Testing - Ran the anti_aliasing example. Compared no AA to SMAA and it looks different now!
1 parent 2146899 commit 5ef1176

File tree

1 file changed

+19
-2
lines changed
  • crates/bevy_anti_alias/src/smaa

1 file changed

+19
-2
lines changed

crates/bevy_anti_alias/src/smaa/mod.rs

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,13 +296,30 @@ impl Plugin for SmaaPlugin {
296296

297297
#[cfg(feature = "smaa_luts")]
298298
let smaa_luts = {
299+
use bevy_asset::RenderAssetUsages;
300+
use bevy_image::ImageLoaderSettings;
301+
299302
// Load the two lookup textures. These are compressed textures in KTX2 format.
300303
embedded_asset!(app, "SMAAAreaLUT.ktx2");
301304
embedded_asset!(app, "SMAASearchLUT.ktx2");
302305

303306
SmaaLuts {
304-
area_lut: load_embedded_asset!(app, "SMAAAreaLUT.ktx2"),
305-
search_lut: load_embedded_asset!(app, "SMAASearchLUT.ktx2"),
307+
area_lut: load_embedded_asset!(
308+
app,
309+
"SMAAAreaLUT.ktx2",
310+
|settings: &mut ImageLoaderSettings| {
311+
settings.is_srgb = false;
312+
settings.asset_usage = RenderAssetUsages::RENDER_WORLD;
313+
}
314+
),
315+
search_lut: load_embedded_asset!(
316+
app,
317+
"SMAASearchLUT.ktx2",
318+
|settings: &mut ImageLoaderSettings| {
319+
settings.is_srgb = false;
320+
settings.asset_usage = RenderAssetUsages::RENDER_WORLD;
321+
}
322+
),
306323
}
307324
};
308325
#[cfg(not(feature = "smaa_luts"))]

0 commit comments

Comments
 (0)