未验证 提交 76c5f558 编写于 作者: M Mr.doob 提交者: GitHub

Merge pull request #20849 from Fluqz/contact-shadows

Example shadow / contact fix
...@@ -117,6 +117,8 @@ ...@@ -117,6 +117,8 @@
transparent: true, transparent: true,
} ); } );
plane = new THREE.Mesh( planeGeometry, planeMaterial ); plane = new THREE.Mesh( planeGeometry, planeMaterial );
plane.material.polygonOffset = true;
plane.material.polygonOffsetFactor = -.1;
shadowGroup.add( plane ); shadowGroup.add( plane );
// the y from the texture is flipped! // the y from the texture is flipped!
...@@ -135,7 +137,6 @@ ...@@ -135,7 +137,6 @@
} ); } );
fillPlane = new THREE.Mesh( planeGeometry, fillPlaneMaterial ); fillPlane = new THREE.Mesh( planeGeometry, fillPlaneMaterial );
fillPlane.rotateX( Math.PI ); fillPlane.rotateX( Math.PI );
fillPlane.position.y -= 0.00001;
shadowGroup.add( fillPlane ); shadowGroup.add( fillPlane );
// the camera to render the depth material from // the camera to render the depth material from
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册