简体   繁体   English

在three.js中无法投射阴影

[英]Trouble casting shadows in three.js

Fiddle: http://jsfiddle.net/8Lhz0kpc/2/ 小提琴: http : //jsfiddle.net/8Lhz0kpc/2/

I've tried to get shadows by following what I've seen in tutorials, but none of the settings seem to work. 我已经尝试按照我在教程中看到的内容来遮盖阴影,但是这些设置似乎都不起作用。

My objects are set to cast & receive Shadow 我的对象设置为投射并接收阴影

@cube.castShadow = true
@cube.receiveShadow = true

The floor is set to receiveShadow 地板设置为阴影

@floor.castShadow = false
@floor.receiveShadow = true

And on the light I have 在光明下

@spotLight.castShadow = true

@spotLight.shadowMapWidth = 1024
@spotLight.shadowMapHeight = 1024

@spotLight.shadowCameraNear = 50
@spotLight.shadowCameraFar = 800
@spotLight.shadowCameraFov = 30
@spotLight.shadowDarkness = 0.5

@spotLight.shadowCameraVisible = true

Not sure where to go from here, might be something simple I've missed? 不知道从这里去哪里,可能是我想念的简单事情?

您编写了sphere.recieveShadow :)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM