diff options
author | Aras Pranckevicius <aras@nesnausk.org> | 2022-09-13 13:28:57 +0300 |
---|---|---|
committer | Aras Pranckevicius <aras@nesnausk.org> | 2022-09-13 15:01:29 +0300 |
commit | a99a62231e040a15c93add9ffa582ec9e1d9c4f1 (patch) | |
tree | 4eefa8527eb047ae20336e5fdd1a8b8b48e2678c /source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc | |
parent | 3839a4dd84877988bcb6023d1757d6fe36786d19 (diff) |
obj: implement support for PBR .mtl extensions
Implement import & export support for "PBR extensions" in .mtl files
(T101029, also fixes T86736).
Newly supported parameters:
- Roughness (Pr, map_Pr)
- Metallic (Pm, map_Pm)
- Sheen (Ps, map_Ps)
- Clearcoat thickness (Pc) and roughness (Pcr)
- Anisotropy (aniso) and rotation (anisor)
- Transmittance (Tf / Kt)
Exporter has an option to enable these additional PBR parameters
export; defaults to off since not all software understands that.
Exporter UI tweaked and all material-related options were put into
their own separate box.
Added/extended test files in Subversion repository for test coverage.
Diffstat (limited to 'source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc')
-rw-r--r-- | source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc | 23 |
1 files changed, 23 insertions, 0 deletions
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 0fd711bdac6..dcba78ac99e 100644 --- a/source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc +++ b/source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc @@ -527,4 +527,27 @@ TEST_F(obj_exporter_regression_test, all_objects_mat_groups) _export.params); } +TEST_F(obj_exporter_regression_test, materials_without_pbr) +{ + OBJExportParamsDefault _export; + _export.params.export_normals = false; + _export.params.path_mode = PATH_REFERENCE_RELATIVE; + compare_obj_export_to_golden("io_tests/blend_geometry/materials_pbr.blend", + "io_tests/obj/materials_without_pbr.obj", + "io_tests/obj/materials_without_pbr.mtl", + _export.params); +} + +TEST_F(obj_exporter_regression_test, materials_pbr) +{ + OBJExportParamsDefault _export; + _export.params.export_normals = false; + _export.params.path_mode = PATH_REFERENCE_RELATIVE; + _export.params.export_pbr_extensions = true; + compare_obj_export_to_golden("io_tests/blend_geometry/materials_pbr.blend", + "io_tests/obj/materials_pbr.obj", + "io_tests/obj/materials_pbr.mtl", + _export.params); +} + } // namespace blender::io::obj |