Three.js - Shadow.bias 修复阴影静态,但移动阴影。怎么修?

Three.js - Shadow.bias fixes shadow static, but moves the shadows. How to fix?

我有一个有灯光投射阴影的场景。它做得很好,除了阴影中的​​ static。像这样:

当我添加一个简单的light.shadow.bias = -0.005;:

它解决了这个问题,但引起了另一个问题。从建筑物的阴影中可以看出,阴影完全不合适!有没有办法解决这个问题,或者有其他方法可以摆脱 shadow static?

您应该可以通过使用新的 normalBias 偏差 属性 来缓解这个问题。来自文档:

Defines how much the position used to query the shadow map is offset along the object normal. The default is 0. Increasing this value can be used to reduce shadow acne especially in large scenes where light shines onto geometry at a shallow angle. The cost is that shadows may appear distorted.