diff --git a/jme3-core/src/main/java/com/jme3/material/ShaderGenerationInfo.java b/jme3-core/src/main/java/com/jme3/material/ShaderGenerationInfo.java index ab06cdf0b..8efc56679 100644 --- a/jme3-core/src/main/java/com/jme3/material/ShaderGenerationInfo.java +++ b/jme3-core/src/main/java/com/jme3/material/ShaderGenerationInfo.java @@ -190,7 +190,13 @@ public class ShaderGenerationInfo implements Savable, Cloneable { @Override protected ShaderGenerationInfo clone() throws CloneNotSupportedException { - ShaderGenerationInfo clone = (ShaderGenerationInfo) super.clone(); + final ShaderGenerationInfo clone = (ShaderGenerationInfo) super.clone(); + clone.attributes = new ArrayList<>(); + clone.vertexUniforms = new ArrayList<>(); + clone.fragmentUniforms = new ArrayList<>(); + clone.fragmentGlobals = new ArrayList<>(); + clone.unusedNodes = new ArrayList<>(); + for (ShaderNodeVariable attribute : attributes) { clone.attributes.add(attribute.clone()); diff --git a/jme3-core/src/main/java/com/jme3/material/TechniqueDef.java b/jme3-core/src/main/java/com/jme3/material/TechniqueDef.java index 429522c59..882d2b63a 100644 --- a/jme3-core/src/main/java/com/jme3/material/TechniqueDef.java +++ b/jme3-core/src/main/java/com/jme3/material/TechniqueDef.java @@ -801,6 +801,7 @@ public class TechniqueDef implements Savable, Cloneable { clone.paramToDefineId.putAll(paramToDefineId); if (shaderNodes != null) { + clone.shaderNodes = new ArrayList<>(); for (ShaderNode shaderNode : shaderNodes) { clone.shaderNodes.add(shaderNode.clone()); }