Skip to content

Commit 588b7bd

Browse files
authored
Merge pull request #546 from FireFlyForLife/master
Fixed maya exporter making textures darker
2 parents 9ca7cc5 + 33592c9 commit 588b7bd

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Maya/Exporter/BabylonExporter.GLTFExporter.Material.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,13 @@ private void ExportMaterial(BabylonMaterial babylonMaterial, GLTF gltf)
160160

161161
// --- Global ---
162162

163+
// Eye Ball correction to limit overall brightness from std to PBR.
164+
// This only impacts the factors.
165+
var correctedDiffuse = new BabylonColor3(babylonStandardMaterial.diffuse).scale(0.5f);
166+
163167
SpecularGlossiness _specularGlossiness = new SpecularGlossiness
164168
{
165-
diffuse = new BabylonColor3(babylonStandardMaterial.diffuse),
169+
diffuse = correctedDiffuse,
166170
opacity = babylonMaterial.alpha,
167171
specular = new BabylonColor3(babylonStandardMaterial.specular),
168172
glossiness = babylonStandardMaterial.specularPower / 256
@@ -601,7 +605,7 @@ float _solveForRoughness(float specularPower)
601605
return _cubicBezierCurve((float)t, P0.Y, P1.Y, P2.Y, P3.Y);
602606
}
603607

604-
var diffuse = specularGlossiness.diffuse.scale(0.5f);
608+
var diffuse = specularGlossiness.diffuse;
605609
var opacity = specularGlossiness.opacity;
606610
var glossiness = specularGlossiness.glossiness;
607611
var metallic = 0;

Maya/Maya2Babylon-1.3.1.zip

7 KB
Binary file not shown.

0 commit comments

Comments
 (0)