|
|
|
@ -69,6 +69,7 @@ public class MaterialLoader implements AssetLoader { |
|
|
|
|
private boolean twoSide = false; |
|
|
|
|
private boolean noLight = false; |
|
|
|
|
private boolean separateTexCoord = false; |
|
|
|
|
private boolean receiveShadow = false; |
|
|
|
|
private int texUnit = 0; |
|
|
|
|
|
|
|
|
|
private ColorRGBA readColor(String content){ |
|
|
|
@ -314,7 +315,8 @@ public class MaterialLoader implements AssetLoader { |
|
|
|
|
readTechnique(statement); |
|
|
|
|
}else if (statement.getLine().startsWith("receive_shadows")){ |
|
|
|
|
String isOn = statement.getLine().split("\\s")[1]; |
|
|
|
|
if (isOn != null && isOn.equals("true")){ |
|
|
|
|
if (isOn != null && isOn.equals("on")){ |
|
|
|
|
receiveShadow = true; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -334,6 +336,11 @@ public class MaterialLoader implements AssetLoader { |
|
|
|
|
mat = new Material(assetManager, "Common/MatDefs/Light/Lighting.j3md"); |
|
|
|
|
} |
|
|
|
|
mat.setName(matName); |
|
|
|
|
|
|
|
|
|
if(receiveShadow){ |
|
|
|
|
mat.setReceivesShadows(true); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (blend){ |
|
|
|
|
RenderState rs = mat.getAdditionalRenderState(); |
|
|
|
|
mat.setFloat("AlphaDiscardThreshold", 0.01f); |
|
|
|
@ -433,6 +440,7 @@ public class MaterialLoader implements AssetLoader { |
|
|
|
|
twoSide = false; |
|
|
|
|
matName = null; |
|
|
|
|
texName = null; |
|
|
|
|
receiveShadow = false; |
|
|
|
|
return mat; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|