提交 78c8960f 编写于 作者: M Mr.doob

Material: Fixed normalMapType serialisation/deserialisation.

上级 52715163
......@@ -124,6 +124,7 @@ Object.assign( MaterialLoader.prototype, {
if ( json.bumpScale !== undefined ) material.bumpScale = json.bumpScale;
if ( json.normalMap !== undefined ) material.normalMap = getTexture( json.normalMap );
if ( json.normalMapType !== undefined ) material.normalMapType = json.normalMapType;
if ( json.normalScale !== undefined ) {
var normalScale = json.normalScale;
......
import { EventDispatcher } from '../core/EventDispatcher.js';
import { NoColors, FrontSide, FlatShading, NormalBlending, LessEqualDepth, AddEquation, OneMinusSrcAlphaFactor, SrcAlphaFactor, TangentSpaceNormalMap } from '../constants.js';
import { NoColors, FrontSide, FlatShading, NormalBlending, LessEqualDepth, AddEquation, OneMinusSrcAlphaFactor, SrcAlphaFactor } from '../constants.js';
import { _Math } from '../math/Math.js';
/**
......@@ -194,7 +194,7 @@ Material.prototype = Object.assign( Object.create( EventDispatcher.prototype ),
if ( this.normalMap && this.normalMap.isTexture ) {
data.normalMap = this.normalMap.toJSON( meta ).uuid;
if ( this.normalMapType !== TangentSpaceNormalMap ) data.normalMapType = this.normalMapType;
data.normalMapType = this.normalMapType;
data.normalScale = this.normalScale.toArray();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册