protected void map(VariableMapping mapping, StringBuilder source, boolean declare) {

        final ShaderNodeVariable leftVariable = mapping.getLeftVariable();
        final ShaderNodeVariable rightVariable = mapping.getRightVariable();
        final String rightExpression = mapping.getRightExpression();

        startCondition(mapping.getCondition(), source);
        appendIndent(source);
        if (!leftVariable.isShaderOutput() &&  declare) {
            source.append(leftVariable.getType());
            source.append(" ");
        }
        source.append(leftVariable.getNameSpace());
        source.append("_");
        source.append(leftVariable.getName());
        if (leftVariable.getMultiplicity() != null){
            source.append("[");
            source.append(leftVariable.getMultiplicity());
            source.append("]");
        }

        // left swizzle, the variable can't be declared and assigned on the same line.
        if (mapping.getLeftSwizzling().length() > 0) {
            //initialize the declared variable to 0.0
            source.append(" = ");
            source.append(leftVariable.getType());
            source.append("(0.0);\n");
            appendIndent(source);
            // assign the value on a new line
            source.append(leftVariable.getNameSpace());
            source.append("_");
            source.append(leftVariable.getName());
            source.append(".");
            source.append(mapping.getLeftSwizzling());
        }
        source.append(" = ");

        if (rightVariable != null) {

            String namePrefix = getAppendableNameSpace(rightVariable);
            source.append(namePrefix);
            source.append(rightVariable.getPrefix());
            source.append(rightVariable.getName());

            if (mapping.getRightSwizzling().length() > 0) {
                source.append(".");
                source.append(mapping.getRightSwizzling());
            }

        } else {
            source.append(rightExpression);
        }

        source.append(";\n");
        endCondition(mapping.getCondition(), source);
    }
Appends a mapping to the source, embed in a conditional block if needed,
with variables nameSpaces and swizzle.

@param mapping the VariableMapping to append
@param source  the StringBuilder to use
@param declare true to declare the variable, false if already declared
jme3-core/src/main/java/com/jme3/shader/Glsl100ShaderGenerator.java