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

MaterialLoader: Add roughness/metalness support.

上级 98c92701
......@@ -60,6 +60,8 @@ THREE.MaterialLoader.prototype = {
if ( json.name !== undefined ) material.name = json.name;
if ( json.color !== undefined ) material.color.setHex( json.color );
if ( json.roughness !== undefined ) material.roughness = json.roughness;
if ( json.metalness !== undefined ) material.metalness = json.metalness;
if ( json.emissive !== undefined ) material.emissive.setHex( json.emissive );
if ( json.specular !== undefined ) material.specular.setHex( json.specular );
if ( json.shininess !== undefined ) material.shininess = json.shininess;
......
......@@ -140,6 +140,10 @@ THREE.Material.prototype = {
if ( this.name !== '' ) data.name = this.name;
if ( this.color instanceof THREE.Color ) data.color = this.color.getHex();
if ( this.roughness !== 0.5 ) data.roughness = this.roughness;
if ( this.metalness > 0 ) data.metalness = this.metalness;
if ( this.emissive instanceof THREE.Color ) data.emissive = this.emissive.getHex();
if ( this.specular instanceof THREE.Color ) data.specular = this.specular.getHex();
if ( this.shininess !== undefined ) data.shininess = this.shininess;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册