From ec13fbce9a13b6684ab109f15fc9b19d378eeb13 Mon Sep 17 00:00:00 2001 From: "Sha..om" Date: Thu, 3 Nov 2011 01:24:56 +0000 Subject: [PATCH] * Fix blender MTL export issue that causes overly shiny models git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8573 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../com/jme3/scene/plugins/MTLLoader.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/engine/src/core-plugins/com/jme3/scene/plugins/MTLLoader.java b/engine/src/core-plugins/com/jme3/scene/plugins/MTLLoader.java index b5c31491c..10cd23683 100644 --- a/engine/src/core-plugins/com/jme3/scene/plugins/MTLLoader.java +++ b/engine/src/core-plugins/com/jme3/scene/plugins/MTLLoader.java @@ -205,10 +205,17 @@ public class MTLLoader implements AssetLoader { }else if (cmd.equals("ks")){ specular.set(readColor()); }else if (cmd.equals("ns")){ - shininess = scan.nextFloat(); /* (128f / 1000f)*/ - if (specular.equals(ColorRGBA.Black)){ - specular.set(ColorRGBA.White); + float shiny = scan.nextFloat(); + if (shiny >= 1){ + shininess = shiny; /* (128f / 1000f)*/ + if (specular.equals(ColorRGBA.Black)){ + specular.set(ColorRGBA.White); + } + }else{ + // For some reason blender likes to export Ns 0 statements + // Ignore Ns 0 instead of setting it } + }else if (cmd.equals("d") || cmd.equals("tr")){ alpha = scan.nextFloat(); transparent = true;