/** * {@inheritDoc} * * Shader outputs are declared and initialized inside the main section */ @Override protected void generateStartOfMainSection(StringBuilder source, ShaderGenerationInfo info, ShaderType type) { source.append("\n"); source.append("void main() {\n"); indent(); appendIndent(source); if (type == ShaderType.Vertex) { declareGlobalPosition(info, source); } else if (type == ShaderType.Fragment) { for (ShaderNodeVariable global : info.getFragmentGlobals()) { declareVariable(source, global, "vec4(1.0)"); } } source.append("\n"); }
/** * {@inheritDoc} * * Shader outputs are declared and initialized inside the main section */ @Override protected void generateStartOfMainSection(StringBuilder source, ShaderGenerationInfo info, ShaderType type) { source.append("\n"); source.append("void main() {\n"); indent(); appendIndent(source); if (type == ShaderType.Vertex) { declareGlobalPosition(info, source); } else if (type == ShaderType.Fragment) { for (ShaderNodeVariable global : info.getFragmentGlobals()) { declareVariable(source, global, "vec4(1.0)"); } } source.append("\n"); }