* 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
3.0
Sha..om 13 years ago
parent 900dc66584
commit ec13fbce9a
  1. 13
      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;

Loading…
Cancel
Save