summaryrefslogtreecommitdiffstats
path: root/editor/import
diff options
context:
space:
mode:
authorSpartan322 <Megacake1234@gmail.com>2024-10-15 06:49:10 -0400
committerSpartan322 <Megacake1234@gmail.com>2024-10-15 06:49:10 -0400
commit8043cc1e0d288d7b517d13f14c912c636293cc8b (patch)
tree79fdac1a76ad232c040f25a4fbae974ac245edda /editor/import
parent7894cd1a5a680020c51e0df96ce8675ad647d91b (diff)
parentaf77100e394dcaca609b15bef815ed17475e51ed (diff)
downloadredot-engine-8043cc1e0d288d7b517d13f14c912c636293cc8b.tar.gz
Merge commit godotengine/godot@af77100e394dcaca609b15bef815ed17475e51ed
Diffstat (limited to 'editor/import')
-rw-r--r--editor/import/resource_importer_layered_texture.cpp9
-rw-r--r--editor/import/resource_importer_texture.cpp7
2 files changed, 5 insertions, 11 deletions
diff --git a/editor/import/resource_importer_layered_texture.cpp b/editor/import/resource_importer_layered_texture.cpp
index 7f9df8d8f9..403ff503e8 100644
--- a/editor/import/resource_importer_layered_texture.cpp
+++ b/editor/import/resource_importer_layered_texture.cpp
@@ -278,6 +278,10 @@ void ResourceImporterLayeredTexture::_save_tex(Vector<Ref<Image>> p_images, cons
f->store_32(0);
f->store_32(0);
+ if ((p_compress_mode == COMPRESS_LOSSLESS || p_compress_mode == COMPRESS_LOSSY) && p_images[0]->get_format() >= Image::FORMAT_RF) {
+ p_compress_mode = COMPRESS_VRAM_UNCOMPRESSED; // These can't go as lossy.
+ }
+
for (int i = 0; i < p_images.size(); i++) {
ResourceImporterTexture::save_to_ctex_format(f, p_images[i], ResourceImporterTexture::CompressMode(p_compress_mode), used_channels, p_vram_compression, p_lossy);
}
@@ -337,11 +341,6 @@ Error ResourceImporterLayeredTexture::import(const String &p_source_file, const
return err;
}
- if (compress_mode == COMPRESS_BASIS_UNIVERSAL && image->get_format() >= Image::FORMAT_RF) {
- //basis universal does not support float formats, fall back
- compress_mode = COMPRESS_VRAM_COMPRESSED;
- }
-
if (compress_mode == COMPRESS_VRAM_COMPRESSED) {
//if using video ram, optimize
if (channel_pack == 0) {
diff --git a/editor/import/resource_importer_texture.cpp b/editor/import/resource_importer_texture.cpp
index 29873915b9..04bdb727f8 100644
--- a/editor/import/resource_importer_texture.cpp
+++ b/editor/import/resource_importer_texture.cpp
@@ -382,7 +382,7 @@ void ResourceImporterTexture::_save_ctex(const Ref<Image> &p_image, const String
f->store_32(0);
f->store_32(0);
- if ((p_compress_mode == COMPRESS_LOSSLESS || p_compress_mode == COMPRESS_LOSSY) && p_image->get_format() > Image::FORMAT_RGBA8) {
+ if ((p_compress_mode == COMPRESS_LOSSLESS || p_compress_mode == COMPRESS_LOSSY) && p_image->get_format() >= Image::FORMAT_RF) {
p_compress_mode = COMPRESS_VRAM_UNCOMPRESSED; //these can't go as lossy
}
@@ -595,11 +595,6 @@ Error ResourceImporterTexture::import(const String &p_source_file, const String
}
}
- if (compress_mode == COMPRESS_BASIS_UNIVERSAL && image->get_format() >= Image::FORMAT_RF) {
- // Basis universal does not support float formats, fallback.
- compress_mode = COMPRESS_VRAM_COMPRESSED;
- }
-
bool detect_3d = int(p_options["detect_3d/compress_to"]) > 0;
bool detect_roughness = roughness == 0;
bool detect_normal = normal == 0;