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

标签 javascript three.js

我有一个带有灯光转换阴影的场景。除了阴影中的​​静态之外,它表现得很好。就像这样:

enter image description here

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

enter image description here

它解决了问题,但导致了另一个问题。从建筑物的阴影中可以看到,阴影完全不协调!有没有办法解决这个问题,或者有替代方法来消除shadow static

最佳答案

您应该能够通过使用新的 normalBias 来缓解该问题属性(property)。来自文档:

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.

关于javascript - Three.js - Shadow.bias 修复阴影静态,但移动阴影。怎么修?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69519670/

相关文章:

javascript - React map 函数 - 随机返回一项

javascript - 在带有流类型注释的js上使用jsdoc

Three.js SceneUtils 没有 traverseHierarchy!!!它在哪里?

three.js - Threejs具有设备方向控制的旋转对象

javascript - Three.js 设备方向控制 : Limit or disable XY rotations

javascript - 我可以在 three.js 中隐藏网格的面吗?

javascript - 在 JavaScript 模板引擎中使用 Markdown

php - 上传大文件时浏览器挂起

javascript - 如何在 JavaScript 中隐藏带有类名的 div

javascript - Three.js:在相机和控件之间切换