From efab383eb201b112c36fe7ec07921f06868b62b3 Mon Sep 17 00:00:00 2001 From: Gyrth Date: Wed, 22 Mar 2023 14:01:23 +0100 Subject: [PATCH] Fixed the caching of textures by writing 4 channels instead of 3. This fixes the banding graphical issue on the terrain. #92 --- Source/Images/image_export.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Images/image_export.cpp b/Source/Images/image_export.cpp index 51752f1fa..eff1c26ad 100644 --- a/Source/Images/image_export.cpp +++ b/Source/Images/image_export.cpp @@ -118,11 +118,11 @@ void ImageExport::SavePNG(const char *file_path, unsigned char *data, unsigned l createfile(file_path); std::string short_path(file_path); ShortenWindowsPath(short_path); - if (!stbi_write_png(short_path.c_str(), width, height, 3, scaled_data.data(), width * 4)) { + if (!stbi_write_png(short_path.c_str(), width, height, 4, scaled_data.data(), width * 4)) { DisplayError("Error", "Problem exporting .png file"); } #else - if (!stbi_write_png(file_path, width, height, 3, scaled_data.data(), width * 4)) { + if (!stbi_write_png(file_path, width, height, 4, scaled_data.data(), width * 4)) { DisplayError("Error", "Problem exporting .png file"); } #endif