Skip to content

Commit 78c8960

Browse files
committed
Material: Fixed normalMapType serialisation/deserialisation.
1 parent 5271516 commit 78c8960

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/loaders/MaterialLoader.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ Object.assign( MaterialLoader.prototype, {
124124
if ( json.bumpScale !== undefined ) material.bumpScale = json.bumpScale;
125125

126126
if ( json.normalMap !== undefined ) material.normalMap = getTexture( json.normalMap );
127+
if ( json.normalMapType !== undefined ) material.normalMapType = json.normalMapType;
127128
if ( json.normalScale !== undefined ) {
128129

129130
var normalScale = json.normalScale;

src/materials/Material.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { EventDispatcher } from '../core/EventDispatcher.js';
2-
import { NoColors, FrontSide, FlatShading, NormalBlending, LessEqualDepth, AddEquation, OneMinusSrcAlphaFactor, SrcAlphaFactor, TangentSpaceNormalMap } from '../constants.js';
2+
import { NoColors, FrontSide, FlatShading, NormalBlending, LessEqualDepth, AddEquation, OneMinusSrcAlphaFactor, SrcAlphaFactor } from '../constants.js';
33
import { _Math } from '../math/Math.js';
44

55
/**
@@ -194,7 +194,7 @@ Material.prototype = Object.assign( Object.create( EventDispatcher.prototype ),
194194
if ( this.normalMap && this.normalMap.isTexture ) {
195195

196196
data.normalMap = this.normalMap.toJSON( meta ).uuid;
197-
if ( this.normalMapType !== TangentSpaceNormalMap ) data.normalMapType = this.normalMapType;
197+
data.normalMapType = this.normalMapType;
198198
data.normalScale = this.normalScale.toArray();
199199

200200
}

0 commit comments

Comments
 (0)