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

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'io_scene_obj/export_obj.py')
-rw-r--r--io_scene_obj/export_obj.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/io_scene_obj/export_obj.py b/io_scene_obj/export_obj.py
index f3b92afd..a147a493 100644
--- a/io_scene_obj/export_obj.py
+++ b/io_scene_obj/export_obj.py
@@ -73,9 +73,11 @@ def write_mtl(scene, filepath, path_mode, copy_set, mtl_dict):
use_mirror = mat_wrap.metallic != 0.0
use_transparency = mat_wrap.transmission != 0.0
- # Convert from principled roughness to 0 - 1000 specular range.
- # XXX Basic linear conversion, what would be best-matching formula here?
- fw('Ns %.6f\n' % ((1.0 - mat_wrap.roughness) * 1000))
+ # XXX Totally empirical conversion, trying to adapt it
+ # (from 1.0 - 0.0 Principled BSDF range to 0.0 - 900.0 OBJ specular exponent range)...
+ spec = (1.0 - mat_wrap.roughness) * 30
+ spec *= spec
+ fw('Ns %.6f\n' % spec)
# Ambient
if use_mirror: