Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHoward Trickey <howard.trickey@gmail.com>2022-02-06 23:00:21 +0300
committerHoward Trickey <howard.trickey@gmail.com>2022-02-06 23:00:21 +0300
commitf199f03994748e7d4b9421cbfd65fdd468ebbdfd (patch)
tree5cad9b374a2a33630f7e2068aeacf26d666a41c7 /source/blender/io
parent9261bc94768ace18b1a16495707a1c6b2912e3d6 (diff)
parent1d59a7aa777909a75420970d50f27be48c96e150 (diff)
Merge branch 'blender-v3.1-release'
Diffstat (limited to 'source/blender/io')
-rw-r--r--source/blender/io/wavefront_obj/exporter/obj_export_mtl.cc4
-rw-r--r--source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc10
2 files changed, 10 insertions, 4 deletions
diff --git a/source/blender/io/wavefront_obj/exporter/obj_export_mtl.cc b/source/blender/io/wavefront_obj/exporter/obj_export_mtl.cc
index 48136dad5f7..3637a3f3c5f 100644
--- a/source/blender/io/wavefront_obj/exporter/obj_export_mtl.cc
+++ b/source/blender/io/wavefront_obj/exporter/obj_export_mtl.cc
@@ -193,8 +193,8 @@ static void store_bsdf_properties(const nodes::NodeRef *bsdf_node,
copy_property_from_node(SOCK_FLOAT, bnode, "Roughness", {&roughness, 1});
}
/* Empirical approximation. Importer should use the inverse of this method. */
- float spec_exponent = (1.0f - roughness) * 30;
- spec_exponent *= spec_exponent;
+ float spec_exponent = (1.0f - roughness);
+ spec_exponent *= spec_exponent * 1000.0f;
float specular = material->spec;
if (bnode) {
diff --git a/source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc b/source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc
index 01f201897cf..58329f63650 100644
--- a/source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc
+++ b/source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc
@@ -345,8 +345,14 @@ class obj_exporter_regression_test : public obj_exporter_test {
std::string output_mtl_str = read_temp_file_in_string(out_mtl_file_path);
std::string golden_mtl_file_path = blender::tests::flags_test_asset_dir() + "/" + golden_mtl;
std::string golden_mtl_str = read_temp_file_in_string(golden_mtl_file_path);
- ASSERT_TRUE(strings_equal_after_first_lines(output_mtl_str, golden_mtl_str));
- BLI_delete(out_mtl_file_path.c_str(), false, false);
+ are_equal = strings_equal_after_first_lines(output_mtl_str, golden_mtl_str);
+ if (save_failing_test_output && !are_equal) {
+ printf("failing test output in %s\n", out_mtl_file_path.c_str());
+ }
+ ASSERT_TRUE(are_equal);
+ if (!save_failing_test_output || are_equal) {
+ BLI_delete(out_mtl_file_path.c_str(), false, false);
+ }
}
}
};