public void storeGlobal(ShaderNodeVariable var, Statement varStatement) throws MatParseException {
        var.setShaderOutput(true);

        final ShaderGenerationInfo generationInfo = techniqueDef.getShaderGenerationInfo();
        final ShaderNodeDefinition definition = shaderNode.getDefinition();

        if (definition.getType() == ShaderType.Vertex) {

            ShaderNodeVariable global = generationInfo.getVertexGlobal();

            if (global != null) {

                if (!global.getName().equals(var.getName())) {
                    throw new MatParseException("A global output is already defined for the vertex shader: " +
                            global.getName() + ". vertex shader can only have one global output", varStatement);
                }

            } else {
                generationInfo.setVertexGlobal(var);
            }

        } else if (definition.getType() == ShaderType.Fragment) {
            storeVariable(var, generationInfo.getFragmentGlobals());
        }
    }
Stores a global output.

@param var the variable to store.
@param varStatement the statement being read.
@throws MatParseException if we have duplicates of a global vertex output variable.
jme3-core/src/plugins/java/com/jme3/material/plugins/ShaderNodeLoaderDelegate.java