8

正如标题所说。当我渲染当前场景时,一切正常。只有白猴的影子被切断了。这怎么会发生,是否有解决方案?

这是网站:http ://hammer.bz/test/ 和一个屏幕;)
http://i.stack.imgur.com/6jd0h.png

我想这与相机或灯光有关..所以它们是:

renderer.shadowMapEnabled   = true;
renderer.sortObjects = false;
renderer.shadowMapWidth = 3072;
renderer.shadowMapHeight = 3072
renderer.shadowCameraNear = 2;
renderer.shadowCameraFar = 40000;
renderer.shadowCameraFov = 50;
renderer.shadowMapBias = -0.00022;
renderer.shadowMapDarkness = 0.55;
renderer.shadowMapSoft      = true;
renderer.physicallyBasedShading = true;
renderer.setClearColorHex( 0x999999, 1 );


camera = new THREE.PerspectiveCamera( 70, window.innerWidth / window.innerHeight, 0.1, 40000 );
camera.position.x = x;
camera.position.y = y;
camera.position.z = z;  
camera.rotation.x = -0.8;
scene.add( camera );


var light = new THREE.DirectionalLight( 0xffffff, 1 );
light.position.set( -2, 5, 2 ).normalize();
light.shadowCameraNear  = 0.01;
light.shadowCameraFar   = 1000000;
light.castShadow        = true;
light.shadowDarkness        = 0.5;
light.shadowCameraVisible   = false;
scene.add( light );

提前致谢!
布拉姆

编辑:明白了:

只是使用THREE.SpotLight。这是一个愚蠢的问题。

只需戴上shadowCameraVisible = true;即可看到光线,它会起作用。现在对这个问题感到有点愚蠢哈哈;)

4

1 回答 1

5

只是使用THREE.SpotLight

只需戴上shadowCameraVisible = true;即可看到光线,它会起作用。Offcourse你需要设置位置position.set(x, y, z);

于 2012-06-07T14:11:04.960 回答