我的 shadowMap 怎么了?
Posted
技术标签:
【中文标题】我的 shadowMap 怎么了?【英文标题】:what's the matter of my shadowMap? 【发布时间】:2017-09-29 10:23:19 【问题描述】:我的shadowMap太小了,怎么回事?
【问题讨论】:
看起来你没有设置阴影贴图相机。我相信不同的灯光会有所不同。要么发布一些代码,要么至少指定您正在使用的灯光(看起来它可能是定向的)。请编辑格式不正确的问题(附加代码) 【参考方案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()
【讨论】:
以上是关于我的 shadowMap 怎么了?的主要内容,如果未能解决你的问题,请参考以下文章
GraphicsLab Project之再谈Shadow Map