Shadows in three.js : r71 vs r76

拈花ヽ惹草 提交于 2019-12-12 00:41:18

问题


I'm building a 3D environment using three.js , r76. I can't seem to get the shadows right.

In r71, I was pretty happy with the result, but it doesn't work the same in r76.

A fiddle to illustrate my problem:

r71: https://jsfiddle.net/sq2w15xy/

r76: https://jsfiddle.net/9uuq6s56/

As you can see, the shadow is black and pixelated in the newest revision. What changed since then? What can I do the get the same smooth shadow as in r71?


回答1:


I suppose the light's shadow.mapSize must be set first as it's otherwise set to ( 512, 512) by default.

        spotlight.shadow.mapSize.width = 2048; 
        spotlight.shadow.mapSize.height  = 2048;


来源:https://stackoverflow.com/questions/38185944/shadows-in-three-js-r71-vs-r76

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!