修复材质bug。

This commit is contained in:
liteng 2018-08-07 12:34:46 +08:00
parent eeb8dabc17
commit acbea70ead
2 changed files with 67 additions and 68 deletions

View File

@ -67,7 +67,6 @@ Converter.prototype.toJSON = function (app) {
// 场景
app.editor.scene.traverse(function (obj) {
var json = null;
debugger
switch (obj.constructor.name) {
case 'Scene':
json = (new SceneSerializer()).toJSON(obj);

View File

@ -13,73 +13,73 @@ MaterialSerializer.prototype.constructor = MaterialSerializer;
MaterialSerializer.prototype.toJSON = function (obj) {
var json = BaseSerializer.prototype.toJSON.call(this, obj);
json.alphaMap = material.alphaMap;
json.alphaTest = material.alphaTest;
json.aoMap = material.aoMap;
json.aoMapIntensity = material.aoMapIntensity;
json.blendDst = material.blendDst;
json.blendDstAlpha = material.blendDstAlpha;
json.blendEquation = material.blendEquation;
json.blendEquationAlpha = material.blendEquationAlpha;
json.blendSrc = material.blendSrc;
json.blendSrcAlpha = material.blendSrcAlpha;
json.blending = material.blending;
json.bumpMap = material.bumpMap;
json.bumpScale = material.bumpScale;
json.clipIntersection = material.clipIntersection;
json.clipShadow = material.clipShadow;
json.clippingPlanes = material.clippingPlanes;
json.color = material.color;
json.colorWrite = material.colorWrite;
json.depthFunc = material.depthFunc;
json.depthTest = material.depthTest;
json.depthWrite = material.depthWrite;
json.displacementBias = material.displacementBias;
json.displacementMap = material.displacementMap;
json.displacementScale = material.displacementScale;
json.dithering = material.dithering;
json.emissive = material.emissive;
json.emissiveIntensity = material.emissiveIntensity;
json.emissiveMap = material.emissiveMap;
json.envMap = material.envMap;
json.envMapIntensity = material.envMapIntensity;
json.flatShading = material.flatShading;
json.fog = material.fog;
json.lightMap = material.lightMap;
json.lightMapIntensity = material.lightMapIntensity;
json.lights = material.lights;
json.linewidth = material.linewidth;
json.map = material.map;
json.metalness = material.metalness;
json.metalnessMap = material.metalnessMap;
json.morphNormals = material.morphNormals;
json.morphTargets = material.morphTargets;
json.name = material.name;
json.normalMap = material.normalMap;
json.normalScale = material.normalScale;
json.opacity = material.opacity;
json.overdraw = material.overdraw;
json.polygonOffset = material.polygonOffset;
json.polygonOffsetFactor = material.polygonOffsetFactor;
json.polygonOffsetUnits = material.polygonOffsetUnits;
json.precision = material.precision;
json.premultipliedAlpha = material.premultipliedAlpha;
json.refractionRatio = material.refractionRatio;
json.roughness = material.roughness;
json.roughnessMap = material.roughnessMap;
json.shadowSide = material.shadowSide;
json.side = material.side;
json.skinning = material.skinning;
json.transparent = material.transparent;
json.type = material.type;
json.userData = material.userData;
json.uuid = material.uuid;
json.vertexColors = material.vertexColors;
json.visible = material.visible;
json.wireframe = material.wireframe;
json.wireframeLinecap = material.wireframeLinecap;
json.wireframeLinejoin = material.wireframeLinejoin;
json.wireframeLinewidth = material.wireframeLinewidth;
json.alphaMap = obj.alphaMap;
json.alphaTest = obj.alphaTest;
json.aoMap = 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;
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;
json.displacementScale = obj.displacementScale;
json.dithering = obj.dithering;
json.emissive = obj.emissive;
json.emissiveIntensity = obj.emissiveIntensity;
json.emissiveMap = obj.emissiveMap;
json.envMap = obj.envMap;
json.envMapIntensity = obj.envMapIntensity;
json.flatShading = obj.flatShading;
json.fog = obj.fog;
json.lightMap = obj.lightMap;
json.lightMapIntensity = obj.lightMapIntensity;
json.lights = obj.lights;
json.linewidth = obj.linewidth;
json.map = obj.map;
json.metalness = obj.metalness;
json.metalnessMap = obj.metalnessMap;
json.morphNormals = obj.morphNormals;
json.morphTargets = obj.morphTargets;
json.name = obj.name;
json.normalMap = obj.normalMap;
json.normalScale = obj.normalScale;
json.opacity = obj.opacity;
json.overdraw = obj.overdraw;
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;
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;
};