/** * {@inheritDoc} * * if the declaration contains no code nothing is done, else it's appended */ @Override protected void generateDeclarativeSection(StringBuilder source, ShaderNode shaderNode, String nodeSource, ShaderGenerationInfo info) { if (nodeSource.replaceAll("\\n", "").trim().length() > 0) { nodeSource = updateDefinesName(nodeSource, shaderNode); source.append("\n"); unIndent(); startCondition(shaderNode.getCondition(), source); source.append(nodeSource); source.append("\n"); endCondition(shaderNode.getCondition(), source); indent(); } }
out.write(" {\n"); if (shaderNode.getCondition() != null){ out.write(" Condition: "); out.write(formatCondition(shaderNode.getCondition(), matParams)); out.write("\n");
source.append("\n"); comment(source, shaderNode, "Begin"); startCondition(shaderNode.getCondition(), source); map(mapping, source, true); endCondition(shaderNode.getCondition(), source); comment(source, shaderNode, "End");
ShaderNode sh2 = def2.getShaderNodes().get(i); assertEquals(sh1.getName(), sh2.getName()); assertEquals(sh1.getCondition(), sh2.getCondition()); assertEquals(sh1.getDefinition().getName(), sh2.getDefinition().getName()); for (int i1 = 0; i1 < sh1.getInputMapping().size(); i1++) {
/** * {@inheritDoc} * * if the declaration contains no code nothing is done, else it's appended */ @Override protected void generateDeclarativeSection(StringBuilder source, ShaderNode shaderNode, String nodeSource, ShaderGenerationInfo info) { if (nodeSource.replaceAll("\\n", "").trim().length() > 0) { nodeSource = updateDefinesName(nodeSource, shaderNode); source.append("\n"); unIndent(); startCondition(shaderNode.getCondition(), source); source.append(nodeSource); source.append("\n"); endCondition(shaderNode.getCondition(), source); indent(); } }
private void writeShaderNode( OutputStreamWriter out, ShaderNode shaderNode, Collection<MatParam> matParams) throws IOException { out.write(" ShaderNode "); out.write(shaderNode.getName()); out.write(" {\n"); if (shaderNode.getCondition() != null){ out.write(" Condition: "); out.write(formatCondition(shaderNode.getCondition(), matParams)); out.write("\n"); } out.write(" Definition: "); out.write(shaderNode.getDefinition().getName()); out.write(": "); out.write(shaderNode.getDefinition().getPath()); out.write("\n"); out.write(" InputMappings {\n"); for (VariableMapping mapping : shaderNode.getInputMapping()) { writeVariableMapping(out, shaderNode, mapping, matParams); } out.write(" }\n"); out.write(" OutputMappings {\n"); for (VariableMapping mapping : shaderNode.getOutputMapping()) { writeVariableMapping(out, shaderNode, mapping, matParams); } out.write(" }\n"); out.write(" }\n"); }
source.append("\n"); comment(source, shaderNode, "Begin"); startCondition(shaderNode.getCondition(), source); map(mapping, source); endCondition(shaderNode.getCondition(), source); comment(source, shaderNode, "End");