Three.js 导入的 obj 不正确的阴影渲染

Three.js imported obj incorrect shadow rendering

我从 blender 导入了一个对象,将它的每个网格都设置为投射和接收阴影,但渲染的阴影不正确。我还合并了对象的网格,认为这会解决问题,但结果是一样的。 使用 side: THREE.DoubleSide 时问题似乎得到解决,但这会使材料变暗。

灯光设置

light = new THREE.DirectionalLight( 0x666666, 1 );
light.position.set(  2*400, 2*300.75, 2*400);
light.position.multiplyScalar( 1.3 );
light.castShadow=true;
light.shadowMapWidth = 2048;
light.shadowMapHeight =2048;
var d = 1300;
light.shadowCameraLeft = -d;
light.shadowCameraRight = d;
light.shadowCameraTop = d;
light.shadowCameraBottom = -d;

light.shadowCameraFar = 10000;
light.shadowBias = 0.0001;
light.shadowDarkness = 0.5;

MATERIAL 设置

var childTilesTexture = THREE.ImageUtils.loadTexture('texture/wood_t.jpg?v1');
childTilesTexture.wrapS = childTilesTexture.wrapT = THREE.RepeatWrapping;
child.material = new THREE.MeshPhongMaterial( { map:childTilesTexture, shininess:5, metal: false} );

屏幕截图

http://i.stack.imgur.com/bsKnU.jpg

另一个屏幕截图

如您所见,手柄通过对象框投射阴影。

http://i.stack.imgur.com/aLMgL.jpg

属性 shadowBias 可用于修复自阴影问题。尝试改变它。

尝试小的负值和小的正值。

three.js r.71