From cc505bad54e405d9c06ec7d232dffbf17e0afb71 Mon Sep 17 00:00:00 2001 From: Marco Fugaro Date: Mon, 11 Jan 2021 21:32:56 +0100 Subject: [PATCH 1/2] Fix contect shadow example --- examples/webgl_shadow_contact.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/webgl_shadow_contact.html b/examples/webgl_shadow_contact.html index ceddd4ad2fb765..69366960a0df98 100644 --- a/examples/webgl_shadow_contact.html +++ b/examples/webgl_shadow_contact.html @@ -115,10 +115,11 @@ map: renderTarget.texture, opacity: state.shadow.opacity, transparent: true, + depthWrite: false, } ); plane = new THREE.Mesh( planeGeometry, planeMaterial ); - plane.material.polygonOffset = true; - plane.material.polygonOffsetFactor = -.1; + // make sure it's rendered ahead the fillPlane + plane.renderOrder = 1; shadowGroup.add( plane ); // the y from the texture is flipped! @@ -134,6 +135,7 @@ color: state.plane.color, opacity: state.plane.opacity, transparent: true, + depthWrite: false, } ); fillPlane = new THREE.Mesh( planeGeometry, fillPlaneMaterial ); fillPlane.rotateX( Math.PI ); From c13a597f51f2f14dc831b2b266b3a60f11eed893 Mon Sep 17 00:00:00 2001 From: Marco Fugaro Date: Mon, 11 Jan 2021 21:52:58 +0100 Subject: [PATCH 2/2] Examples: better comment in contact shadow examples --- examples/webgl_shadow_contact.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/webgl_shadow_contact.html b/examples/webgl_shadow_contact.html index 69366960a0df98..6b96bc5dd03c3b 100644 --- a/examples/webgl_shadow_contact.html +++ b/examples/webgl_shadow_contact.html @@ -118,7 +118,7 @@ depthWrite: false, } ); plane = new THREE.Mesh( planeGeometry, planeMaterial ); - // make sure it's rendered ahead the fillPlane + // make sure it's rendered after the fillPlane plane.renderOrder = 1; shadowGroup.add( plane );