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:
authorAras Pranckevicius <aras@nesnausk.org>2022-09-13 13:28:57 +0300
committerAras Pranckevicius <aras@nesnausk.org>2022-09-13 15:01:29 +0300
commita99a62231e040a15c93add9ffa582ec9e1d9c4f1 (patch)
tree4eefa8527eb047ae20336e5fdd1a8b8b48e2678c /source/blender/io/wavefront_obj/exporter/obj_export_mtl.hh
parent3839a4dd84877988bcb6023d1757d6fe36786d19 (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/exporter/obj_export_mtl.hh')
-rw-r--r--source/blender/io/wavefront_obj/exporter/obj_export_mtl.hh14
1 files changed, 13 insertions, 1 deletions
diff --git a/source/blender/io/wavefront_obj/exporter/obj_export_mtl.hh b/source/blender/io/wavefront_obj/exporter/obj_export_mtl.hh
index 32933a16c4d..9c1bc2f0f8f 100644
--- a/source/blender/io/wavefront_obj/exporter/obj_export_mtl.hh
+++ b/source/blender/io/wavefront_obj/exporter/obj_export_mtl.hh
@@ -15,11 +15,14 @@ namespace blender::io::obj {
enum class MTLTexMapType {
Color = 0,
+ Metallic,
Specular,
SpecularExponent,
- Alpha,
+ Roughness,
+ Sheen,
Reflection,
Emission,
+ Alpha,
Normal,
Count
};
@@ -63,6 +66,15 @@ struct MTLMaterial {
float3 emission_color{-1.0f}; /* `Ke` */
float ior{-1.0f}; /* `Ni` */
float alpha{-1.0f}; /* `d` */
+ float3 transmit_color{-1.0f}; /* `Kt` / `Tf` */
+ float roughness{-1.0f}; /* `Pr` */
+ float metallic{-1.0f}; /* `Pm` */
+ float sheen{-1.0f}; /* `Ps` */
+ float cc_thickness{-1.0f}; /* `Pc` */
+ float cc_roughness{-1.0f}; /* `Pcr` */
+ float aniso{-1.0f}; /* `aniso` */
+ float aniso_rot{-1.0f}; /* `anisor` */
+
int illum_mode{-1};
MTLTexMap texture_maps[(int)MTLTexMapType::Count];
/* Only used for Normal Map node: `map_Bump`. */