From 84e6ac9ecdfdc280520cbb6c217c15447f1cbb6c Mon Sep 17 00:00:00 2001
From: BlueCube3310 <53150244+BlueCube3310@users.noreply.github.com>
Date: Mon, 6 Jan 2025 12:31:22 +0100
Subject: [PATCH] Web: Export ASTC/BPTC compressed textures
---
platform/web/doc_classes/EditorExportPlatformWeb.xml | 4 ++--
platform/web/export/export_plugin.cpp | 2 ++
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/platform/web/doc_classes/EditorExportPlatformWeb.xml b/platform/web/doc_classes/EditorExportPlatformWeb.xml
index 955e3a0232ed..08632392beb8 100644
--- a/platform/web/doc_classes/EditorExportPlatformWeb.xml
+++ b/platform/web/doc_classes/EditorExportPlatformWeb.xml
@@ -87,10 +87,10 @@
If [code]false[/code], the exported game will not support threads. As a result, it is more prone to performance and audio issues, but will only require to be run on an HTTPS website.
- If [code]true[/code], allows textures to be optimized for desktop through the S3TC algorithm.
+ If [code]true[/code], allows textures to be optimized for desktop through the S3TC/BPTC algorithm.
- If [code]true[/code] allows textures to be optimized for mobile through the ETC2 algorithm.
+ If [code]true[/code] allows textures to be optimized for mobile through the ETC2/ASTC algorithm.
diff --git a/platform/web/export/export_plugin.cpp b/platform/web/export/export_plugin.cpp
index 142a8deb86d7..177493d50051 100644
--- a/platform/web/export/export_plugin.cpp
+++ b/platform/web/export/export_plugin.cpp
@@ -334,9 +334,11 @@ Error EditorExportPlatformWeb::_build_pwa(const Ref &p_prese
void EditorExportPlatformWeb::get_preset_features(const Ref &p_preset, List *r_features) const {
if (p_preset->get("vram_texture_compression/for_desktop")) {
r_features->push_back("s3tc");
+ r_features->push_back("bptc");
}
if (p_preset->get("vram_texture_compression/for_mobile")) {
r_features->push_back("etc2");
+ r_features->push_back("astc");
}
if (p_preset->get("variant/thread_support").operator bool()) {
r_features->push_back("threads");