From 7752728a7e612762684f95c8c7c8992b247167c9 Mon Sep 17 00:00:00 2001 From: Don McCurdy Date: Sun, 22 Dec 2019 20:37:56 -0800 Subject: [PATCH 1/2] GLTFLoader: Use depthWrite=false for transparent materials --- examples/js/loaders/GLTFLoader.js | 3 +++ examples/jsm/loaders/GLTFLoader.js | 3 +++ 2 files changed, 6 insertions(+) diff --git a/examples/js/loaders/GLTFLoader.js b/examples/js/loaders/GLTFLoader.js index c1fdc4021a563f..bbf3c774dcdc8b 100644 --- a/examples/js/loaders/GLTFLoader.js +++ b/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; diff --git a/examples/jsm/loaders/GLTFLoader.js b/examples/jsm/loaders/GLTFLoader.js index 9766e82bddd404..cdf5989ac2d44c 100644 --- a/examples/jsm/loaders/GLTFLoader.js +++ b/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; From 21498d1ccf0475a8ea5825a7d1d09a33c53aa6d6 Mon Sep 17 00:00:00 2001 From: Don McCurdy Date: Fri, 21 Feb 2020 22:13:16 -0800 Subject: [PATCH 2/2] Examples: Remove unneeded material patch in unreal bloom example. --- examples/webgl_postprocessing_unreal_bloom.html | 5 ----- 1 file changed, 5 deletions(-) diff --git a/examples/webgl_postprocessing_unreal_bloom.html b/examples/webgl_postprocessing_unreal_bloom.html index 859d3685212e02..66878533f93a09 100644 --- a/examples/webgl_postprocessing_unreal_bloom.html +++ b/examples/webgl_postprocessing_unreal_bloom.html @@ -92,11 +92,6 @@ scene.add( model ); - // Mesh contains self-intersecting semi-transparent faces, which display - // z-fighting unless depthWrite is disabled. - var core = model.getObjectByName( 'geo1_HoloFillDark_0' ); - core.material.depthWrite = false; - mixer = new THREE.AnimationMixer( model ); var clip = gltf.animations[ 0 ]; mixer.clipAction( clip.optimize() ).play();