diff options
author | Juan Linietsky <reduzio@gmail.com> | 2017-05-29 22:11:33 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2017-05-30 08:56:19 -0300 |
commit | 5567e898d1052c1e2c2d32d3c37dfd957f4dc4bd (patch) | |
tree | e0df9b88b6c485f846dab9ae51369288f191cab8 /editor | |
parent | 0a6faeb4f5914061c29d946eaa29f2c50b8472fb (diff) |
Several fixes related to PBR and Environment
Diffstat (limited to 'editor')
-rw-r--r-- | editor/editor_node.cpp | 2 | ||||
-rw-r--r-- | editor/import/resource_importer_texture.cpp | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 245b350790..c1f422cce3 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -1380,7 +1380,7 @@ void EditorNode::_property_editor_back() { void EditorNode::_save_default_environment() { - Ref<Environment> fallback = get_scene_root()->get_world()->get_fallback_environment(); + Ref<Environment> fallback = get_tree()->get_root()->get_world()->get_fallback_environment(); if (fallback.is_valid() && fallback->get_path().is_resource_file()) { Map<RES, bool> processed; diff --git a/editor/import/resource_importer_texture.cpp b/editor/import/resource_importer_texture.cpp index f27a01d119..17feeb1196 100644 --- a/editor/import/resource_importer_texture.cpp +++ b/editor/import/resource_importer_texture.cpp @@ -177,6 +177,7 @@ void ResourceImporterTexture::get_import_options(List<ImportOption> *r_options, r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "flags/srgb", PROPERTY_HINT_ENUM, "Disable,Enable,Detect"), 2)); r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "process/fix_alpha_border"), p_preset != PRESET_3D ? true : false)); r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "process/premult_alpha"), true)); + r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "process/HDR_as_SRGB"), false)); r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "stream"), false)); r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "size_limit", PROPERTY_HINT_RANGE, "0,4096,1"), 0)); r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "detect_3d"), p_preset == PRESET_DETECT)); @@ -327,10 +328,11 @@ Error ResourceImporterTexture::import(const String &p_source_file, const String bool stream = p_options["stream"]; int size_limit = p_options["size_limit"]; bool force_rgbe = int(p_options["compress/hdr_mode"]) == 1; + bool hdr_as_srgb = p_options["process/HDR_as_SRGB"]; Ref<Image> image; image.instance(); - Error err = ImageLoader::load_image(p_source_file, image); + Error err = ImageLoader::load_image(p_source_file, image, NULL, hdr_as_srgb); if (err != OK) return err; |