From bcbfaa347a9a871c9b64d76f0ca46b5a2c8f407f Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Mon, 11 Oct 2021 14:02:14 +0200 Subject: [PATCH] Disable compression for lightmaps on Linux (due to low-quality alpha encoding) --- Source/Engine/Level/Scene/Lightmap.cpp | 4 ++++ Source/Engine/ShadowsOfMordor/Builder.BuildCache.cpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/Source/Engine/Level/Scene/Lightmap.cpp b/Source/Engine/Level/Scene/Lightmap.cpp index 2559005a9..580b7380e 100644 --- a/Source/Engine/Level/Scene/Lightmap.cpp +++ b/Source/Engine/Level/Scene/Lightmap.cpp @@ -111,7 +111,11 @@ void Lightmap::EnsureSize(int32 size) ImportTexture::Options options; options.Type = TextureFormatType::HdrRGBA; options.IndependentChannels = true; +#if PLATFORM_WINDOWS options.Compress = _manager->GetScene()->GetLightmapSettings().CompressLightmaps; +#else + options.Compress = false; // TODO: use better BC7 compressor that would handle alpha more precisely (otherwise lightmaps have artifacts, see TextureTool.stb.cpp) +#endif options.IsAtlas = false; options.sRGB = false; options.NeverStream = false; diff --git a/Source/Engine/ShadowsOfMordor/Builder.BuildCache.cpp b/Source/Engine/ShadowsOfMordor/Builder.BuildCache.cpp index 5228d7594..e06e59625 100644 --- a/Source/Engine/ShadowsOfMordor/Builder.BuildCache.cpp +++ b/Source/Engine/ShadowsOfMordor/Builder.BuildCache.cpp @@ -122,7 +122,11 @@ void ShadowsOfMordor::Builder::SceneBuildCache::UpdateLightmaps() ImportTexture::Options options; options.Type = TextureFormatType::HdrRGBA; options.IndependentChannels = true; +#if PLATFORM_WINDOWS options.Compress = Scene->GetLightmapSettings().CompressLightmaps; +#else + options.Compress = false; // TODO: use better BC7 compressor that would handle alpha more precisely (otherwise lightmaps have artifacts, see TextureTool.stb.cpp) +#endif options.GenerateMipMaps = true; options.IsAtlas = false; options.sRGB = false;