@Override
    public void write(JmeExporter ex) throws IOException {
        OutputCapsule oc = ex.getCapsule(this);
        oc.write(true, "pointSprite", false);
        oc.write(wireframe, "wireframe", false);
        oc.write(cullMode, "cullMode", FaceCullMode.Back);
        oc.write(depthWrite, "depthWrite", true);
        oc.write(depthTest, "depthTest", true);
        oc.write(colorWrite, "colorWrite", true);
        oc.write(blendMode, "blendMode", BlendMode.Off);
        oc.write(offsetEnabled, "offsetEnabled", false);
        oc.write(offsetFactor, "offsetFactor", 0);
        oc.write(offsetUnits, "offsetUnits", 0);
        oc.write(stencilTest, "stencilTest", false);
        oc.write(frontStencilStencilFailOperation, "frontStencilStencilFailOperation", StencilOperation.Keep);
        oc.write(frontStencilDepthFailOperation, "frontStencilDepthFailOperation", StencilOperation.Keep);
        oc.write(frontStencilDepthPassOperation, "frontStencilDepthPassOperation", StencilOperation.Keep);
        oc.write(backStencilStencilFailOperation, "backStencilStencilFailOperation", StencilOperation.Keep);
        oc.write(backStencilDepthFailOperation, "backStencilDepthFailOperation", StencilOperation.Keep);
        oc.write(backStencilDepthPassOperation, "backStencilDepthPassOperation", StencilOperation.Keep);
        oc.write(frontStencilFunction, "frontStencilFunction", TestFunction.Always);
        oc.write(backStencilFunction, "backStencilFunction", TestFunction.Always);
        oc.write(frontStencilReference, "frontStencilReference", 0);
        oc.write(backStencilReference, "backStencilReference", 0);
        oc.write(frontStencilMask, "frontStencilMask", Integer.MAX_VALUE);
        oc.write(backStencilMask, "backStencilMask", Integer.MAX_VALUE);
        oc.write(blendEquation, "blendEquation", BlendEquation.Add);
        oc.write(blendEquationAlpha, "blendEquationAlpha", BlendEquationAlpha.InheritColor);
        oc.write(depthFunc, "depthFunc", TestFunction.LessOrEqual);
        oc.write(lineWidth, "lineWidth", 1);
        oc.write(sfactorRGB, "sfactorRGB", BlendFunc.One);
        oc.write(dfactorRGB, "dfactorRGB", BlendFunc.One);
        oc.write(sfactorAlpha, "sfactorAlpha", BlendFunc.One);
        oc.write(dfactorAlpha, "dfactorAlpha", BlendFunc.One);

        // Only "additional render state" has them set to false by default
        oc.write(applyWireFrame, "applyWireFrame", true);
        oc.write(applyCullMode, "applyCullMode", true);
        oc.write(applyDepthWrite, "applyDepthWrite", true);
        oc.write(applyDepthTest, "applyDepthTest", true);
        oc.write(applyColorWrite, "applyColorWrite", true);
        oc.write(applyBlendMode, "applyBlendMode", true);
        oc.write(applyPolyOffset, "applyPolyOffset", true);
        oc.write(applyDepthFunc, "applyDepthFunc", true);
        oc.write(applyLineWidth, "applyLineWidth", true);

    }
Does a bitwise invert of the value in the stencil buffer.
jme3-core/src/main/java/com/jme3/material/RenderState.java