【问题标题】:what's the matter of my shadowMap?我的 shadowMap 怎么了?
【发布时间】:2017-09-29 10:23:19
【问题描述】:

我的shadowMap太小了,怎么回事?

【问题讨论】:

  • 看起来你没有设置阴影贴图相机。我相信不同的灯光会有所不同。要么发布一些代码,要么至少指定您正在使用的灯光(看起来它可能是定向的)。请编辑格式不正确的问题(附加代码)

标签: three.js


【解决方案1】:

您可能没有(正确地)设置阴影贴图相机。

From the docs:

默认为 OrthographicCamera,left 和 bottom 设置为 -5,right 和 top 设置为 5,近裁剪平面为 0.5,远裁剪平面为 500。

意思:

yourLight.shadow.camera.left = -500 //(default is -5)
yourLight.shadow.camera.right = 500 //(default is 5)
yourLight.shadow.camera.top = -500 //(default is -5)
yourLight.shadow.camera.bottom = 500 //(default is 5)

//not sure if this is needed, the docs do not mention it even though they are changing the projection so probably not needed
yourLight.shadow.camera.updateProjectionMatrix()

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-09-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多