未验证 提交 444f5737 编写于 作者: M Mr.doob 提交者: GitHub

Merge pull request #13904 from takahirox/MaterialToJSONAo

 Add missing aoMap and aoMapIntensity to Material.toJSON()
......@@ -176,18 +176,28 @@ Material.prototype = Object.assign( Object.create( EventDispatcher.prototype ),
if ( this.map && this.map.isTexture ) data.map = this.map.toJSON( meta ).uuid;
if ( this.alphaMap && this.alphaMap.isTexture ) data.alphaMap = this.alphaMap.toJSON( meta ).uuid;
if ( this.lightMap && this.lightMap.isTexture ) data.lightMap = this.lightMap.toJSON( meta ).uuid;
if ( this.aoMap && this.aoMap.isTexture ) {
data.aoMap = this.aoMap.toJSON( meta ).uuid;
data.aoMapIntensity = this.aoMapIntensity;
}
if ( this.bumpMap && this.bumpMap.isTexture ) {
data.bumpMap = this.bumpMap.toJSON( meta ).uuid;
data.bumpScale = this.bumpScale;
}
if ( this.normalMap && this.normalMap.isTexture ) {
data.normalMap = this.normalMap.toJSON( meta ).uuid;
data.normalScale = this.normalScale.toArray();
}
if ( this.displacementMap && this.displacementMap.isTexture ) {
data.displacementMap = this.displacementMap.toJSON( meta ).uuid;
......@@ -195,6 +205,7 @@ Material.prototype = Object.assign( Object.create( EventDispatcher.prototype ),
data.displacementBias = this.displacementBias;
}
if ( this.roughnessMap && this.roughnessMap.isTexture ) data.roughnessMap = this.roughnessMap.toJSON( meta ).uuid;
if ( this.metalnessMap && this.metalnessMap.isTexture ) data.metalnessMap = this.metalnessMap.toJSON( meta ).uuid;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册