captDaylight captDaylight - 1 year ago 198
React JSX Question

Shadow not being cast with ThreeJS in react-three-renderer

I'm having trouble casting a shadow in my scene. Steps I've taken:

  1. shadowMapEnabled attribute added to the React3 element

  2. the directional light in my scene has verbatim the properties I see here in the react-three-renderer example

  3. all three meshes (one cube and two planes) in the scene have castShadow and receiveShadow

I have a black cube in the image below to show where the directional light is eminating from.

enter image description here

Here's a gist of my code. (abbreviated)

Answer Source

Try reducing the shadow camera's near value, it looks too high. If you can provide a full example it may be easier to diagnose what's happening

Additionally try to place a different object at the "lookAt" target for the light, this should help identify in which direction it will face

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download