diff options
| author | Rémi Verschelde <remi@verschelde.fr> | 2022-06-01 18:34:54 +0200 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-01 18:34:54 +0200 | 
| commit | fc18891dbceace03c3867ac26c15b79cfbc673df (patch) | |
| tree | 85471fe9664dd27887bd9d15ec7070c58591b348 | |
| parent | c762ec134321f0710b2c8cfe3939abe76f12ff68 (diff) | |
| parent | f06ad0374ef97fc3b51e492c25938f8fc425d34a (diff) | |
Merge pull request #61497 from Calinou/texture-import-detect-3d-print
| -rw-r--r-- | editor/import/resource_importer_texture.cpp | 8 | 
1 files changed, 7 insertions, 1 deletions
diff --git a/editor/import/resource_importer_texture.cpp b/editor/import/resource_importer_texture.cpp index 5364b53b57..71b8c54422 100644 --- a/editor/import/resource_importer_texture.cpp +++ b/editor/import/resource_importer_texture.cpp @@ -104,24 +104,30 @@ void ResourceImporterTexture::update_imports() {  			bool changed = false;  			if (E.value.flags & MAKE_NORMAL_FLAG && int(cf->get_value("params", "compress/normal_map")) == 0) { +				print_line(vformat("%s: Texture detected as used as a normal map in 3D. Enabling red-green texture compression to reduce memory usage (blue channel is discarded).", String(E.key)));  				cf->set_value("params", "compress/normal_map", 1);  				changed = true;  			}  			if (E.value.flags & MAKE_ROUGHNESS_FLAG && int(cf->get_value("params", "roughness/mode")) == 0) { +				print_line(vformat("%s: Texture detected as used as a roughness map in 3D. Enabling roughness limiter based on the detected associated normal map at %s.", String(E.key), E.value.normal_path_for_roughness));  				cf->set_value("params", "roughness/mode", E.value.channel_for_roughness + 2);  				cf->set_value("params", "roughness/src_normal", E.value.normal_path_for_roughness);  				changed = true;  			}  			if (E.value.flags & MAKE_3D_FLAG && bool(cf->get_value("params", "detect_3d/compress_to"))) { -				int compress_to = cf->get_value("params", "detect_3d/compress_to"); +				const int compress_to = cf->get_value("params", "detect_3d/compress_to"); +				String compress_string;  				cf->set_value("params", "detect_3d/compress_to", 0);  				if (compress_to == 1) {  					cf->set_value("params", "compress/mode", COMPRESS_VRAM_COMPRESSED); +					compress_string = "VRAM Compressed (S3TC/ETC/BPTC)";  				} else if (compress_to == 2) {  					cf->set_value("params", "compress/mode", COMPRESS_BASIS_UNIVERSAL); +					compress_string = "Basis Universal";  				} +				print_line(vformat("%s: Texture detected as used in 3D. Enabling mipmap generation and setting the texture compression mode to %s.", String(E.key), compress_string));  				cf->set_value("params", "mipmaps/generate", true);  				changed = true;  			}  |