简体   繁体   中英

Trouble casting shadows in three.js

Fiddle: 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 :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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