#Cascaded Shadow Map Help

7 messages · Page 1 of 1 (latest)

obtuse flicker
#

I need a shadow map to move with the player / camera. When I rotate my camera, my shadows glide away. What to do?

I basically just copied this, but have a moving player / camera.
https://sbcode.net/threejs/csm/

let csm = CSM({
  camera: camera,
  parent: scene,
  lightDirection: ,
})
// In update loop
csm.update()
camera.position.set(...)
obtuse flicker
#

Is my camera rotated wrong 😭 ???

summer epoch
#

looks like your camera is bound on your player, but you probably want it on your scene object itself. idk csm tbh though. add a light helper it will show you where it actually is. shadow camera takes a little bit to understand

#

oh you have a helper I see now. actually seems maybe it's behaving right? try just adjusting your light position, target, and shadow.camera parameters

#

what's the game? nice basic scene so far

obtuse flicker
summer epoch
#

well the nice thing about threejs is, you dont have to understand quaternions ! haha. i've build almost a whole game using them extensively, but i could not do the matrix math behind them to save my life. I just think of them as "orientation" basically.