提交 f94562b5 编写于 作者: T Takahiro

Clean up color setting in GLTF2Loader

上级 0727fc42
......@@ -1201,7 +1201,8 @@ THREE.GLTF2Loader = ( function () {
var metallicRoughness = material.pbrMetallicRoughness;
materialParams.color = new THREE.Color();
materialParams.color = new THREE.Color( 1.0, 1.0, 1.0 );
materialParams.opacity = 1.0;
if ( Array.isArray( metallicRoughness.baseColorFactor ) ) {
......@@ -1210,11 +1211,6 @@ THREE.GLTF2Loader = ( function () {
materialParams.color.fromArray( array );
materialParams.opacity = array[ 3 ];
} else {
materialParams.color.setRGB( 1.0, 1.0, 1.0 );
materialParams.opacity = 1.0;
}
if ( metallicRoughness.baseColorTexture !== undefined ) {
......@@ -1265,16 +1261,12 @@ THREE.GLTF2Loader = ( function () {
}
materialParams.emissive = new THREE.Color();
materialParams.emissive = new THREE.Color( 0.0, 0.0, 0.0 );
if ( material.emissiveFactor !== undefined ) {
materialParams.emissive.fromArray( material.emissiveFactor );
} else {
materialParams.emissive.setRGB( 0.0, 0.0, 0.0 );
}
Object.assign( materialValues, material.values );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册