* Blender now supports loading color for shadeless materials
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9006 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
3478012756
commit
03fb684b10
@ -69,7 +69,12 @@ public final class MaterialContext {
|
||||
diffuseShader = DiffuseShader.values()[diff_shader];
|
||||
|
||||
if(this.shadeless) {
|
||||
diffuseColor = ColorRGBA.White.clone();
|
||||
float r = ((Number) structure.getFieldValue("r")).floatValue();
|
||||
float g = ((Number) structure.getFieldValue("g")).floatValue();
|
||||
float b = ((Number) structure.getFieldValue("b")).floatValue();
|
||||
float alpha = ((Number) structure.getFieldValue("alpha")).floatValue();
|
||||
|
||||
diffuseColor = new ColorRGBA(r, g, b, alpha);
|
||||
specularShader = null;
|
||||
specularColor = ambientColor = null;
|
||||
shininess = 0.0f;
|
||||
|
@ -241,6 +241,12 @@ public class MaterialHelper extends AbstractBlenderHelper {
|
||||
} else {
|
||||
if (materialContext.shadeless) {
|
||||
result = new Material(blenderContext.getAssetManager(), "Common/MatDefs/Misc/Unshaded.j3md");
|
||||
|
||||
if (!materialContext.transparent) {
|
||||
materialContext.diffuseColor.a = 1;
|
||||
}
|
||||
|
||||
result.setColor("Color", materialContext.diffuseColor);
|
||||
} else {
|
||||
result = new Material(blenderContext.getAssetManager(), "Common/MatDefs/Light/Lighting.j3md");
|
||||
result.setBoolean("UseMaterialColors", Boolean.TRUE);
|
||||
|
Loading…
x
Reference in New Issue
Block a user