summaryrefslogtreecommitdiff
path: root/editor/import/resource_importer_texture.h
diff options
context:
space:
mode:
Diffstat (limited to 'editor/import/resource_importer_texture.h')
-rw-r--r--editor/import/resource_importer_texture.h21
1 files changed, 16 insertions, 5 deletions
diff --git a/editor/import/resource_importer_texture.h b/editor/import/resource_importer_texture.h
index fbfd47f4f0..acbfde8430 100644
--- a/editor/import/resource_importer_texture.h
+++ b/editor/import/resource_importer_texture.h
@@ -33,7 +33,7 @@
#include "core/image.h"
#include "core/io/resource_importer.h"
-
+#include "servers/visual_server.h"
class StreamTexture;
class ResourceImporterTexture : public ResourceImporter {
@@ -42,14 +42,25 @@ class ResourceImporterTexture : public ResourceImporter {
protected:
enum {
MAKE_3D_FLAG = 1,
- MAKE_SRGB_FLAG = 2,
+ MAKE_ROUGHNESS_FLAG = 2,
MAKE_NORMAL_FLAG = 4
};
Mutex *mutex;
- Map<StringName, int> make_flags;
+ struct MakeInfo {
+
+ int flags;
+ String normal_path_for_roughness;
+ VS::TextureDetectRoughnessChannel channel_for_roughness;
+ MakeInfo() {
+ flags = 0;
+ channel_for_roughness = VS::TEXTURE_DETECT_ROUGNHESS_R;
+ }
+ };
+
+ Map<StringName, MakeInfo> make_flags;
- static void _texture_reimport_srgb(const Ref<StreamTexture> &p_tex);
+ static void _texture_reimport_roughness(const Ref<StreamTexture> &p_tex, const String &p_normal_path, VisualServer::TextureDetectRoughnessChannel p_channel);
static void _texture_reimport_3d(const Ref<StreamTexture> &p_tex);
static void _texture_reimport_normal(const Ref<StreamTexture> &p_tex);
@@ -84,7 +95,7 @@ public:
virtual void get_import_options(List<ImportOption> *r_options, int p_preset = 0) const;
virtual bool get_option_visibility(const String &p_option, const Map<StringName, Variant> &p_options) const;
- void _save_stex(const Ref<Image> &p_image, const String &p_to_path, int p_compress_mode, float p_lossy_quality, Image::CompressMode p_vram_compression, bool p_mipmaps, int p_texture_flags, bool p_streamable, bool p_detect_3d, bool p_detect_srgb, bool p_force_rgbe, bool p_detect_normal, bool p_force_normal, bool p_force_po2_for_compressed);
+ void _save_stex(const Ref<Image> &p_image, const String &p_to_path, int p_compress_mode, float p_lossy_quality, Image::CompressMode p_vram_compression, bool p_mipmaps, bool p_streamable, bool p_detect_3d, bool p_detect_srgb, bool p_force_rgbe, bool p_detect_normal, bool p_force_normal, bool p_srgb_friendly, bool p_force_po2_for_compressed);
virtual Error import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files = NULL, Variant *r_metadata = NULL);