Skip to content

Commit

Permalink
Merge pull request #21063 from marcofugaro/contact-shadow-fix
Browse files Browse the repository at this point in the history
Examples: Fix contact shadow example
  • Loading branch information
mrdoob authored Jan 12, 2021
2 parents 23f9bab + c13a597 commit 81c13ce
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions examples/webgl_shadow_contact.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 after the fillPlane
plane.renderOrder = 1;
shadowGroup.add( plane );

// the y from the texture is flipped!
Expand All @@ -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 );
Expand Down

0 comments on commit 81c13ce

Please sign in to comment.