Search code examples
three.jsaframeshadow

How do i ask shadow in Aframe


enter image description here

enter image description here

I use Aframejs but, shadow is not working. shadow is cut off. How to work....

this is example https://glitch.com/edit/#!/noisy-celestial-abrosaurus?path=index.html%3A15%3A30


Solution

  • The shadows are generated with the help of an internal camera, which corresponds to the area affected by the light.

    You can visualize it with a light property called shadowCameraVisible. In your case, You should see something like this:

    enter image description here

    See how the box is partially outside of the yellow boundary? That explains why the shadow is suddenly cut off. You need to adjust the camera properties to envelop the entire scene:

    light="type:directional;
           color:#ffffff;
           intensity:1;
           castShadow:true;
           shadowCameraTop:    10;
           shadowCameraRight:  10;
           shadowCameraLeft:  -10" 
    

    glitch here