gltf: Add GLTFHandleBinary::HANDLE_BINARY_EMBED_AS_UNCOMPRESSED

This option allows for a safe fallback for embedded gltf textures in cases where VRAM compression is not needed.
Add an is_editor_hint guard around GLTFHandleBinary::HANDLE_BINARY_EXTRACT_TEXTURES, to use EMBED_AS_UNCOMPRESSED by default at runtime.
This provides an option for pixel art to be stored losslessly.
Additionally, respect project importer defaults for texture import settings.
Avoid writing and reimporting extracted textures identical to version on disk.
This commit is contained in:
Lyuma 2023-01-30 23:37:55 -08:00
parent 0810ecaafd
commit bc24d01359
6 changed files with 81 additions and 31 deletions

View file

@ -264,10 +264,16 @@
</members>
<constants>
<constant name="HANDLE_BINARY_DISCARD_TEXTURES" value="0">
Discards all embedded textures and uses untextured materials.
</constant>
<constant name="HANDLE_BINARY_EXTRACT_TEXTURES" value="1">
Extracts embedded textures to be reimported and compressed. Editor only. Acts as uncompressed at runtime.
</constant>
<constant name="HANDLE_BINARY_EMBED_AS_BASISU" value="2">
Embeds textures VRAM compressed with Basis Universal into the generated scene.
</constant>
<constant name="HANDLE_BINARY_EMBED_AS_UNCOMPRESSED" value="3">
Embeds textures compressed losslessly into the generated scene, matching old behavior.
</constant>
</constants>
</class>