So… I've implemented ambient, diffuse and specular color loading from an Ogre Materiallist file.
Here's the patch:
Index: MaterialLoader.java
--- MaterialLoader.java Base (BASE)
+++ MaterialLoader.java Locally Modified (Based On LOCAL)
@@ -24,7 +24,7 @@
private String folderName;
private AssetManager assetManager;
private Scanner scan;
- private ColorRGBA diffuse, specular;
+ private ColorRGBA ambient, diffuse, specular;
private Texture texture;
private String texName;
private String matName;
@@ -155,6 +155,8 @@
}else{
diffuse = readColor();
}
+ }else if(keyword.equals("ambient")) {
+ ambient = readColor();
}else if (keyword.equals("specular")){
specular = new ColorRGBA();
specular.r = scan.nextFloat();
@@ -282,6 +284,10 @@
if (texture != null)
mat.setTexture("m_DiffuseMap", texture);
+ if(diffuse != null) mat.setColor("m_Diffuse", diffuse);
+ if(ambient != null) mat.setColor("m_Ambient", ambient);
+ if(specular != null) mat.setColor("m_Specular", specular);
+
texture = null;
diffuse = null;
specular = null;
cheers,
Tim