* Fix colors reference issue in MTL loader
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7537 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
8cefea550e
commit
c9a5e0953a
@ -111,15 +111,15 @@ public class MTLLoader implements AssetLoader {
|
|||||||
|
|
||||||
if (shadeless){
|
if (shadeless){
|
||||||
material = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
|
material = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
|
||||||
material.setColor("Color", diffuse);
|
material.setColor("Color", diffuse.clone());
|
||||||
material.setTexture("ColorMap", diffuseMap);
|
material.setTexture("ColorMap", diffuseMap);
|
||||||
// TODO: Add handling for alpha map?
|
// TODO: Add handling for alpha map?
|
||||||
}else{
|
}else{
|
||||||
material = new Material(assetManager, "Common/MatDefs/Light/Lighting.j3md");
|
material = new Material(assetManager, "Common/MatDefs/Light/Lighting.j3md");
|
||||||
material.setBoolean("UseMaterialColors", true);
|
material.setBoolean("UseMaterialColors", true);
|
||||||
material.setColor("Ambient", ambient);
|
material.setColor("Ambient", ambient.clone());
|
||||||
material.setColor("Diffuse", diffuse);
|
material.setColor("Diffuse", diffuse.clone());
|
||||||
material.setColor("Specular", specular);
|
material.setColor("Specular", specular.clone());
|
||||||
material.setFloat("Shininess", shininess); // prevents "premature culling" bug
|
material.setFloat("Shininess", shininess); // prevents "premature culling" bug
|
||||||
|
|
||||||
if (diffuseMap != null) material.setTexture("DiffuseMap", diffuseMap);
|
if (diffuseMap != null) material.setTexture("DiffuseMap", diffuseMap);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user