diff options
author | K. S. Ernest (iFire) Lee <fire@users.noreply.github.com> | 2022-07-18 17:58:27 -0700 |
---|---|---|
committer | Lyuma <xn.lyuma@gmail.com> | 2023-01-27 02:02:02 -0800 |
commit | 39922d7167178bab9587aa00a7a108b93db6240e (patch) | |
tree | 51e404a83385757d913207cee245a1af6aba8512 /modules/gltf/gltf_state.h | |
parent | d1e5903c67956707948b1de370b807e3aad395b7 (diff) |
Handle gltf binary
[ Ignore and Warn | Extract Textures (default) | Optimize Loading Embedded as Basisu ]
Enable compressed mip maps from Basis Universal for faster compressions.
Increase the quality of Basis to avoid corruption.
To keep compatibility use the first mip of the previous internal Godot format.
Because texture names may have invalid filename characters, adds String::validate_filename to sanitize filenames for import pipeline use.
Diffstat (limited to 'modules/gltf/gltf_state.h')
-rw-r--r-- | modules/gltf/gltf_state.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/modules/gltf/gltf_state.h b/modules/gltf/gltf_state.h index 488ad038aa..47b98a91b6 100644 --- a/modules/gltf/gltf_state.h +++ b/modules/gltf/gltf_state.h @@ -59,6 +59,8 @@ class GLTFState : public Resource { bool discard_meshes_and_materials = false; bool create_animations = true; + int handle_binary_image = HANDLE_BINARY_EXTRACT_TEXTURES; + Vector<Ref<GLTFNode>> nodes; Vector<Vector<uint8_t>> buffers; Vector<Ref<GLTFBufferView>> buffer_views; @@ -78,6 +80,7 @@ class GLTFState : public Resource { Vector<Ref<Texture2D>> images; Vector<String> extensions_used; Vector<String> extensions_required; + Vector<Ref<Image>> source_images; Vector<Ref<GLTFSkin>> skins; Vector<Ref<GLTFCamera>> cameras; @@ -100,6 +103,18 @@ protected: public: void add_used_extension(const String &p_extension, bool p_required = false); + enum GLTFHandleBinary { + HANDLE_BINARY_DISCARD_TEXTURES = 0, + HANDLE_BINARY_EXTRACT_TEXTURES, + HANDLE_BINARY_EMBED_AS_BASISU, + }; + int32_t get_handle_binary_image() { + return handle_binary_image; + } + void set_handle_binary_image(int32_t p_handle_binary_image) { + handle_binary_image = p_handle_binary_image; + } + Dictionary get_json(); void set_json(Dictionary p_json); @@ -115,6 +130,15 @@ public: bool get_use_named_skin_binds(); void set_use_named_skin_binds(bool p_use_named_skin_binds); + bool get_discard_textures(); + void set_discard_textures(bool p_discard_textures); + + bool get_embed_as_basisu(); + void set_embed_as_basisu(bool p_embed_as_basisu); + + bool get_extract_textures(); + void set_extract_textures(bool p_extract_textures); + bool get_discard_meshes_and_materials(); void set_discard_meshes_and_materials(bool p_discard_meshes_and_materials); |