diff options
author | Ferenc Arn <tagcup@yahoo.com> | 2017-04-26 10:49:08 -0500 |
---|---|---|
committer | Ferenc Arn <tagcup@yahoo.com> | 2017-05-31 18:59:00 -0500 |
commit | 6a9c990da72a737fa95d9e97d53f835706aea7c3 (patch) | |
tree | 0f5c1d36279bef5d0d5c84fc1d3fb24256b65ba8 /editor | |
parent | bd26fa7bf2bf02f9ef17ad4ef3a93ffed3ffcf56 (diff) |
Add ETC1/ETC2 compression support though etc2comp.
Remove rg-etc1 code. Also updated travis to use ubuntu 14.04.
Fixes #8457.
Diffstat (limited to 'editor')
-rw-r--r-- | editor/import/resource_importer_texture.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/editor/import/resource_importer_texture.cpp b/editor/import/resource_importer_texture.cpp index 7e27f6c618..1a88c45eac 100644 --- a/editor/import/resource_importer_texture.cpp +++ b/editor/import/resource_importer_texture.cpp @@ -144,8 +144,12 @@ String ResourceImporterTexture::get_resource_type() const { bool ResourceImporterTexture::get_option_visibility(const String &p_option, const Map<StringName, Variant> &p_options) const { - if (p_option == "compress/lossy_quality" && int(p_options["compress/mode"]) != COMPRESS_LOSSY) - return false; + if (p_option == "compress/lossy_quality") { + int compress_mode = int(p_options["compress/mode"]); + if (compress_mode != COMPRESS_LOSSY && compress_mode != COMPRESS_VIDEO_RAM) { + return false; + } + } return true; } @@ -277,7 +281,7 @@ void ResourceImporterTexture::_save_stex(const Ref<Image> &p_image, const String if (p_force_rgbe && image->get_format() >= Image::FORMAT_R8 && image->get_format() <= Image::FORMAT_RGBE9995) { image->convert(Image::FORMAT_RGBE9995); } else { - image->compress(p_vram_compression, p_texture_flags & VS::TEXTURE_FLAG_CONVERT_TO_LINEAR); + image->compress(p_vram_compression, p_texture_flags & VS::TEXTURE_FLAG_CONVERT_TO_LINEAR, p_lossy_quality); } format |= image->get_format(); @@ -382,8 +386,8 @@ Error ResourceImporterTexture::import(const String &p_source_file, const String //Android, GLES 2.x _save_stex(image, p_save_path + ".etc.stex", compress_mode, lossy, Image::COMPRESS_ETC, mipmaps, tex_flags, stream, detect_3d, detect_srgb, force_rgbe); r_platform_variants->push_back("etc"); - //_save_stex(image,p_save_path+".etc2.stex",compress_mode,lossy,Image::COMPRESS_ETC2,mipmaps,tex_flags,stream); - //r_platform_variants->push_back("etc2"); + _save_stex(image, p_save_path + ".etc2.stex", compress_mode, lossy, Image::COMPRESS_ETC2, mipmaps, tex_flags, stream, detect_3d, detect_srgb, force_rgbe); + r_platform_variants->push_back("etc2"); _save_stex(image, p_save_path + ".s3tc.stex", compress_mode, lossy, Image::COMPRESS_S3TC, mipmaps, tex_flags, stream, detect_3d, detect_srgb, force_rgbe); r_platform_variants->push_back("s3tc"); |