toJSON(obj) {
        var json = BaseSerializer.prototype.toJSON.call(this, obj);

        json.alphaMap = !obj.alphaMap ? null : new TexturesSerializer().toJSON(obj.alphaMap);
        json.alphaTest = obj.alphaTest;
        json.aoMap = !obj.aoMap ? null : new TexturesSerializer().toJSON(obj.aoMap);
        json.aoMapIntensity = obj.aoMapIntensity;
        json.blendDst = obj.blendDst;
        json.blendDstAlpha = obj.blendDstAlpha;
        json.blendEquation = obj.blendEquation;
        json.blendEquationAlpha = obj.blendEquationAlpha;
        json.blendSrc = obj.blendSrc;
        json.blendSrcAlpha = obj.blendSrcAlpha;
        json.blending = obj.blending;
        json.bumpMap = !obj.bumpMap ? null : new TexturesSerializer().toJSON(obj.bumpMap);
        json.bumpScale = obj.bumpScale;
        json.clipIntersection = obj.clipIntersection;
        json.clipShadow = obj.clipShadow;
        json.clippingPlanes = obj.clippingPlanes;
        json.color = obj.color;
        json.colorWrite = obj.colorWrite;
        json.depthFunc = obj.depthFunc;
        json.depthTest = obj.depthTest;
        json.depthWrite = obj.depthWrite;
        json.displacementBias = obj.displacementBias;
        json.displacementMap = !obj.displacementMap ? null : new TexturesSerializer().toJSON(obj.displacementMap);
        json.displacementScale = obj.displacementScale;
        json.dithering = obj.dithering;
        json.emissive = obj.emissive;
        json.emissiveIntensity = obj.emissiveIntensity;
        json.emissiveMap = !obj.emissiveMap ? null : new TexturesSerializer().toJSON(obj.emissiveMap);

        if (obj.specular) {
            json.specular = obj.specular;
        }
        if (obj.specularMap) {
            json.specularMap = new TexturesSerializer().toJSON(obj.specularMap);
        }

        json.envMap = !obj.envMap ? null : new TexturesSerializer().toJSON(obj.envMap);
        json.envMapIntensity = obj.envMapIntensity;
        json.flatShading = obj.flatShading;
        json.fog = obj.fog;
        json.lightMap = !obj.lightMap ? null : new TexturesSerializer().toJSON(obj.lightMap);
        json.lightMapIntensity = obj.lightMapIntensity;
        json.lights = obj.lights;
        json.linewidth = obj.linewidth;
        json.map = !obj.map ? null : new TexturesSerializer().toJSON(obj.map);
        json.metalness = obj.metalness;
        json.metalnessMap = !obj.metalnessMap ? null : new TexturesSerializer().toJSON(obj.metalnessMap);
        json.morphNormals = obj.morphNormals;
        json.morphTargets = obj.morphTargets;
        json.name = obj.name;
        json.normalMap = !obj.normalMap ? null : new TexturesSerializer().toJSON(obj.normalMap);
        json.normalScale = obj.normalScale;
        json.opacity = obj.opacity;
        json.polygonOffset = obj.polygonOffset;
        json.polygonOffsetFactor = obj.polygonOffsetFactor;
        json.polygonOffsetUnits = obj.polygonOffsetUnits;
        json.precision = obj.precision;
        json.premultipliedAlpha = obj.premultipliedAlpha;
        json.refractionRatio = obj.refractionRatio;
        json.roughness = obj.roughness;
        json.roughnessMap = !obj.roughnessMap ? null : new TexturesSerializer().toJSON(obj.roughnessMap);
        json.shadowSide = obj.shadowSide;
        json.side = obj.side;
        json.skinning = obj.skinning;
        json.transparent = obj.transparent;
        json.type = obj.type;
        json.userData = obj.userData;
        json.uuid = obj.uuid;
        json.vertexColors = obj.vertexColors;
        json.visible = obj.visible;
        json.wireframe = obj.wireframe;
        json.wireframeLinecap = obj.wireframeLinecap;
        json.wireframeLinejoin = obj.wireframeLinejoin;
        json.wireframeLinewidth = obj.wireframeLinewidth;

        return json;
    }
MaterialSerializer
@author tengge / https://github.com/tengge1