|
|
|
@ -102,6 +102,7 @@ public class TechniqueDef implements Savable { |
|
|
|
|
private List<ShaderNode> shaderNodes; |
|
|
|
|
private ShaderGenerationInfo shaderGenerationInfo; |
|
|
|
|
|
|
|
|
|
private boolean noRender = false; |
|
|
|
|
private RenderState renderState; |
|
|
|
|
private RenderState forcedRenderState; |
|
|
|
|
|
|
|
|
@ -201,6 +202,28 @@ public class TechniqueDef implements Savable { |
|
|
|
|
this.renderState = renderState; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Sets if this technique should not be used to render. |
|
|
|
|
* |
|
|
|
|
* @param noRender not render or render ? |
|
|
|
|
* |
|
|
|
|
* @see NoRender |
|
|
|
|
*/ |
|
|
|
|
public void setNoRender(boolean noRender) { |
|
|
|
|
this.noRender = noRender; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Returns true if this technique should not be used to render. |
|
|
|
|
* (eg. to not render a material with default technique) |
|
|
|
|
* |
|
|
|
|
* @return true if this technique should not be rendered, false otherwise. |
|
|
|
|
* |
|
|
|
|
*/ |
|
|
|
|
public boolean isNoRender(){ |
|
|
|
|
return noRender; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @deprecated jME3 always requires shaders now |
|
|
|
|
*/ |
|
|
|
@ -448,6 +471,7 @@ public class TechniqueDef implements Savable { |
|
|
|
|
oc.write(lightMode, "lightMode", LightMode.Disable); |
|
|
|
|
oc.write(shadowMode, "shadowMode", ShadowMode.Disable); |
|
|
|
|
oc.write(renderState, "renderState", null); |
|
|
|
|
oc.write(noRender, "noRender", false); |
|
|
|
|
oc.write(usesNodes, "usesNodes", false); |
|
|
|
|
oc.writeSavableArrayList((ArrayList)shaderNodes,"shaderNodes", null); |
|
|
|
|
oc.write(shaderGenerationInfo, "shaderGenerationInfo", null); |
|
|
|
@ -470,6 +494,7 @@ public class TechniqueDef implements Savable { |
|
|
|
|
lightMode = ic.readEnum("lightMode", LightMode.class, LightMode.Disable); |
|
|
|
|
shadowMode = ic.readEnum("shadowMode", ShadowMode.class, ShadowMode.Disable); |
|
|
|
|
renderState = (RenderState) ic.readSavable("renderState", null); |
|
|
|
|
noRender = ic.readBoolean("noRender", false); |
|
|
|
|
|
|
|
|
|
if (ic.getSavableVersion(TechniqueDef.class) == 0) { |
|
|
|
|
// Old version
|
|
|
|
@ -525,6 +550,6 @@ public class TechniqueDef implements Savable { |
|
|
|
|
//todo: make toString return something usefull
|
|
|
|
|
@Override |
|
|
|
|
public String toString() { |
|
|
|
|
return "TechniqueDef{" + "requiredCaps=" + requiredCaps + ", name=" + name /*+ ", vertName=" + vertName + ", fragName=" + fragName + ", vertLanguage=" + vertLanguage + ", fragLanguage=" + fragLanguage */+ ", presetDefines=" + presetDefines + ", usesNodes=" + usesNodes + ", shaderNodes=" + shaderNodes + ", shaderGenerationInfo=" + shaderGenerationInfo + ", renderState=" + renderState + ", forcedRenderState=" + forcedRenderState + ", lightMode=" + lightMode + ", shadowMode=" + shadowMode + ", defineParams=" + defineParams + ", worldBinds=" + worldBinds + '}'; |
|
|
|
|
return "TechniqueDef{" + "requiredCaps=" + requiredCaps + ", name=" + name /*+ ", vertName=" + vertName + ", fragName=" + fragName + ", vertLanguage=" + vertLanguage + ", fragLanguage=" + fragLanguage */+ ", presetDefines=" + presetDefines + ", usesNodes=" + usesNodes + ", shaderNodes=" + shaderNodes + ", shaderGenerationInfo=" + shaderGenerationInfo + ", renderState=" + renderState + ", forcedRenderState=" + forcedRenderState + ", lightMode=" + lightMode + ", shadowMode=" + shadowMode + ", defineParams=" + defineParams + ", worldBinds=" + worldBinds + ", noRender=" + noRender + '}'; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|