public VariableMapping readOutputMapping(Statement statement) throws MatParseException {

        VariableMapping mapping;
        try {
            mapping = parseMapping(statement, OM_HAS_NAME_SPACE);
        } catch (final Exception e) {
            throw new MatParseException("Unexpected mapping format", statement, e);
        }

        final ShaderNodeDefinition definition = shaderNode.getDefinition();
        final ShaderNodeVariable left = mapping.getLeftVariable();
        final ShaderNodeVariable right = mapping.getRightVariable();

        if (left.getType().startsWith("sampler") || right.getType().startsWith("sampler")) {
            throw new MatParseException("Samplers can only be inputs", statement);
        }

        if (left.getNameSpace().equals(ShaderGenerator.NAME_SPACE_GLOBAL)) {
            left.setType("vec4"); // Globals are all vec4 for now (maybe forever...)
            storeGlobal(left, statement);
        } else {
            throw new MatParseException("Only Global nameSpace is allowed for outputMapping, got" + left.getNameSpace(), statement);
        }

        if (!updateVariableFromList(right, definition.getOutputs())) {
            throw new MatParseException(right.getName() + " is not an output variable of " + definition.getName(), statement);
        }

        checkTypes(mapping, statement);

        return mapping;
    }
Reads an output mapping.

@param statement the statement being read.
@return the mapping
@throws MatParseException if we have a problem with parsing the statement.
jme3-core/src/plugins/java/com/jme3/material/plugins/ShaderNodeLoaderDelegate.java