|
|
@ -93,7 +93,6 @@ public class Material implements CloneableSmartAsset, Cloneable, Savable { |
|
|
|
private ListMap<String, MatParam> paramValues = new ListMap<String, MatParam>(); |
|
|
|
private ListMap<String, MatParam> paramValues = new ListMap<String, MatParam>(); |
|
|
|
private Technique technique; |
|
|
|
private Technique technique; |
|
|
|
private HashMap<String, Technique> techniques = new HashMap<String, Technique>(); |
|
|
|
private HashMap<String, Technique> techniques = new HashMap<String, Technique>(); |
|
|
|
private int nextTexUnit = 0; |
|
|
|
|
|
|
|
private RenderState additionalState = null; |
|
|
|
private RenderState additionalState = null; |
|
|
|
private RenderState mergedRenderState = new RenderState(); |
|
|
|
private RenderState mergedRenderState = new RenderState(); |
|
|
|
private boolean transparent = false; |
|
|
|
private boolean transparent = false; |
|
|
@ -510,16 +509,6 @@ public class Material implements CloneableSmartAsset, Cloneable, Savable { |
|
|
|
|
|
|
|
|
|
|
|
paramValues.remove(name); |
|
|
|
paramValues.remove(name); |
|
|
|
if (matParam instanceof MatParamTexture) { |
|
|
|
if (matParam instanceof MatParamTexture) { |
|
|
|
int texUnit = ((MatParamTexture) matParam).getUnit(); |
|
|
|
|
|
|
|
nextTexUnit--; |
|
|
|
|
|
|
|
for (MatParam param : paramValues.values()) { |
|
|
|
|
|
|
|
if (param instanceof MatParamTexture) { |
|
|
|
|
|
|
|
MatParamTexture texParam = (MatParamTexture) param; |
|
|
|
|
|
|
|
if (texParam.getUnit() > texUnit) { |
|
|
|
|
|
|
|
texParam.setUnit(texParam.getUnit() - 1); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
sortingId = -1; |
|
|
|
sortingId = -1; |
|
|
|
} |
|
|
|
} |
|
|
|
if (technique != null) { |
|
|
|
if (technique != null) { |
|
|
@ -562,13 +551,13 @@ public class Material implements CloneableSmartAsset, Cloneable, Savable { |
|
|
|
+ "Linear using texture.getImage.setColorSpace().", |
|
|
|
+ "Linear using texture.getImage.setColorSpace().", |
|
|
|
new Object[]{value.getName(), value.getImage().getColorSpace().name(), name}); |
|
|
|
new Object[]{value.getName(), value.getImage().getColorSpace().name(), name}); |
|
|
|
} |
|
|
|
} |
|
|
|
paramValues.put(name, new MatParamTexture(type, name, value, nextTexUnit++, null)); |
|
|
|
paramValues.put(name, new MatParamTexture(type, name, value, null)); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
val.setTextureValue(value); |
|
|
|
val.setTextureValue(value); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (technique != null) { |
|
|
|
if (technique != null) { |
|
|
|
technique.notifyParamChanged(name, type, nextTexUnit - 1); |
|
|
|
technique.notifyParamChanged(name, type, value); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// need to recompute sort ID
|
|
|
|
// need to recompute sort ID
|
|
|
@ -1078,11 +1067,6 @@ public class Material implements CloneableSmartAsset, Cloneable, Savable { |
|
|
|
MatParam param = entry.getValue(); |
|
|
|
MatParam param = entry.getValue(); |
|
|
|
if (param instanceof MatParamTexture) { |
|
|
|
if (param instanceof MatParamTexture) { |
|
|
|
MatParamTexture texVal = (MatParamTexture) param; |
|
|
|
MatParamTexture texVal = (MatParamTexture) param; |
|
|
|
|
|
|
|
|
|
|
|
if (nextTexUnit < texVal.getUnit() + 1) { |
|
|
|
|
|
|
|
nextTexUnit = texVal.getUnit() + 1; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// the texture failed to load for this param
|
|
|
|
// the texture failed to load for this param
|
|
|
|
// do not add to param values
|
|
|
|
// do not add to param values
|
|
|
|
if (texVal.getTextureValue() == null || texVal.getTextureValue().getImage() == null) { |
|
|
|
if (texVal.getTextureValue() == null || texVal.getTextureValue().getImage() == null) { |
|
|
|