Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Examples: Fix contact shadow example #21063

Merged
merged 2 commits into from
Jan 12, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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