|
|
@ -377,9 +377,9 @@ public class Material implements Cloneable, Savable, Comparable<Material> { |
|
|
|
name = checkSetParam(null, name); |
|
|
|
name = checkSetParam(null, name); |
|
|
|
|
|
|
|
|
|
|
|
MatParamTexture val = getTextureParam(name); |
|
|
|
MatParamTexture val = getTextureParam(name); |
|
|
|
if (val == null) { |
|
|
|
if (val == null) |
|
|
|
throw new IllegalArgumentException("The given texture parameter is not set."); |
|
|
|
throw new IllegalArgumentException("The given texture parameter is not set."); |
|
|
|
} else { |
|
|
|
|
|
|
|
int texUnit = val.getUnit(); |
|
|
|
int texUnit = val.getUnit(); |
|
|
|
paramValues.remove(name); |
|
|
|
paramValues.remove(name); |
|
|
|
nextTexUnit--; |
|
|
|
nextTexUnit--; |
|
|
@ -391,7 +391,8 @@ public class Material implements Cloneable, Savable, Comparable<Material> { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
sortingId = -1; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setTextureParam(String name, VarType type, Texture value) { |
|
|
|
public void setTextureParam(String name, VarType type, Texture value) { |
|
|
@ -410,6 +411,9 @@ public class Material implements Cloneable, Savable, Comparable<Material> { |
|
|
|
if (technique != null) { |
|
|
|
if (technique != null) { |
|
|
|
technique.notifySetParam(name, type, nextTexUnit - 1); |
|
|
|
technique.notifySetParam(name, type, nextTexUnit - 1); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// need to recompute sort ID
|
|
|
|
|
|
|
|
sortingId = -1; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -547,8 +551,7 @@ public class Material implements Cloneable, Savable, Comparable<Material> { |
|
|
|
* @param lightList |
|
|
|
* @param lightList |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
protected void updateLightListUniforms(Shader shader, Geometry g, int numLights) { |
|
|
|
protected void updateLightListUniforms(Shader shader, Geometry g, int numLights) { |
|
|
|
if (numLights == 0) // this shader does not do lighting, ignore.
|
|
|
|
if (numLights == 0){ // this shader does not do lighting, ignore.
|
|
|
|
{ |
|
|
|
|
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -732,6 +735,9 @@ public class Material implements Cloneable, Savable, Comparable<Material> { |
|
|
|
|
|
|
|
|
|
|
|
technique = tech; |
|
|
|
technique = tech; |
|
|
|
tech.makeCurrent(def.getAssetManager()); |
|
|
|
tech.makeCurrent(def.getAssetManager()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// shader was changed
|
|
|
|
|
|
|
|
sortingId = -1; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void autoSelectTechnique(RenderManager rm) { |
|
|
|
private void autoSelectTechnique(RenderManager rm) { |
|
|
|