Explorar o código

GLTFLoader: Use depthWrite=false for transparent materials

Don McCurdy %!s(int64=5) %!d(string=hai) anos
pai
achega
7752728a7e
Modificáronse 2 ficheiros con 6 adicións e 0 borrados
  1. 3 0
      examples/js/loaders/GLTFLoader.js
  2. 3 0
      examples/jsm/loaders/GLTFLoader.js

+ 3 - 0
examples/js/loaders/GLTFLoader.js

@@ -2099,6 +2099,9 @@ THREE.GLTFLoader = ( function () {
 
 			materialParams.transparent = true;
 
+			// See: https://github.com/mrdoob/three.js/issues/17706
+			materialParams.depthWrite = false;
+
 		} else if ( alphaMode === ALPHA_MODES.MASK ) {
 
 			materialParams.alphaTest = materialDef.alphaCutoff !== undefined ? materialDef.alphaCutoff : 0.5;

+ 3 - 0
examples/jsm/loaders/GLTFLoader.js

@@ -2162,6 +2162,9 @@ var GLTFLoader = ( function () {
 
 			materialParams.transparent = true;
 
+			// See: https://github.com/mrdoob/three.js/issues/17706
+			materialParams.depthWrite = false;
+
 		} else if ( alphaMode === ALPHA_MODES.MASK ) {
 
 			materialParams.alphaTest = materialDef.alphaCutoff !== undefined ? materialDef.alphaCutoff : 0.5;