Explorar el Código

Fix collada transparency handling. (#22907)

According to the official collada specification, the opaque attribute for the transparent object is optional, and the default value is 'A_ONE'.
Viktor Kovacs hace 3 años
padre
commit
92bb9158ef
Se han modificado 1 ficheros con 1 adiciones y 2 borrados
  1. 1 2
      examples/jsm/loaders/ColladaLoader.js

+ 1 - 2
examples/jsm/loaders/ColladaLoader.js

@@ -1276,7 +1276,7 @@ class ColladaLoader extends Loader {
 						break;
 					case 'transparent':
 						data[ child.nodeName ] = {
-							opaque: child.getAttribute( 'opaque' ),
+							opaque: child.hasAttribute( 'opaque' ) ? child.getAttribute( 'opaque' ) : 'A_ONE',
 							data: parseEffectParameter( child )
 						};
 						break;
@@ -1737,7 +1737,6 @@ class ColladaLoader extends Loader {
 							material.opacity = color[ 0 ] * transparency.float;
 							break;
 						default:
-							material.opacity = 1 - transparency.float;
 							console.warn( 'THREE.ColladaLoader: Invalid opaque type "%s" of transparent tag.', transparent.opaque );
 
 					}