diff --git a/source/export/exporterobj.js b/source/export/exporterobj.js index 6473f64..eb98e17 100644 --- a/source/export/exporterobj.js +++ b/source/export/exporterobj.js @@ -44,7 +44,7 @@ OV.ExporterObj = class extends OV.ExporterBase mtlWriter.WriteArrayLine (['Ka', material.ambient.r / 255.0, material.ambient.g / 255.0, material.ambient.b / 255.0]); mtlWriter.WriteArrayLine (['Kd', material.diffuse.r / 255.0, material.diffuse.g / 255.0, material.diffuse.b / 255.0]); mtlWriter.WriteArrayLine (['Ks', material.specular.r / 255.0, material.specular.g / 255.0, material.specular.b / 255.0]); - mtlWriter.WriteArrayLine (['Ns', material.shininess * 100.0]); + mtlWriter.WriteArrayLine (['Ns', material.shininess * 1000.0]); mtlWriter.WriteArrayLine (['d', material.opacity]); WriteTexture (mtlWriter, 'map_Kd', material.diffuseMap, files); WriteTexture (mtlWriter, 'map_Ks', material.specularMap, files); diff --git a/source/external/three.converter.js b/source/external/three.converter.js index 2020e6f..cc2e129 100644 --- a/source/external/three.converter.js +++ b/source/external/three.converter.js @@ -39,7 +39,7 @@ OV.ConvertModelToThreeMeshes = function (model, callbacks) color : diffuseColor, specular : specularColor, emissive : emissiveColor, - shininess : material.shininess * 10.0, + shininess : material.shininess * 100.0, opacity : material.opacity, transparent : material.transparent, alphaTest : material.alphaTest, diff --git a/source/import/importer3ds.js b/source/import/importer3ds.js index 04e58e9..3ebeff5 100644 --- a/source/import/importer3ds.js +++ b/source/import/importer3ds.js @@ -163,8 +163,8 @@ OV.Importer3ds = class extends OV.ImporterBase } }); - if (shininess !== null || shininessStrength !== null) { - material.shininess = shininess * shininessStrength; + if (shininess !== null && shininessStrength !== null) { + material.shininess = shininess * shininessStrength / 10.0; } let materialIndex = this.model.AddMaterial (material); this.materialNameToIndex[material.name] = materialIndex; diff --git a/source/import/importerobj.js b/source/import/importerobj.js index 12a65b5..198bc28 100644 --- a/source/import/importerobj.js +++ b/source/import/importerobj.js @@ -258,7 +258,7 @@ OV.ImporterObj = class extends OV.ImporterBase if (this.currentMaterial === null || parameters.length < 1) { return true; } - this.currentMaterial.shininess = parseFloat (parameters[0]) / 100.0; + this.currentMaterial.shininess = parseFloat (parameters[0]) / 1000.0; return true; } else if (keyword === 'tr') { if (this.currentMaterial === null || parameters.length < 1) {