Merge branch 'blender-v3.1-release'

This commit is contained in:
Howard Trickey 2022-02-06 15:00:21 -05:00
commit f199f03994
2 changed files with 10 additions and 4 deletions

View File

@ -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) {

View File

@ -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);
}
}
}
};