Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Shadows cast by objects out Field of View keep popping in and out

Discussion in 'VR' started by uglymug, Sep 17, 2021.

  1. uglymug

    uglymug

    Joined:
    Jul 14, 2016
    Posts:
    6
    Hi,

    I'm having a problem with shadows in my VR Game. To explain the issue simply; imagine a tree that is to my left and it is casting a shadow in front of me. Now if the tree is in my field of view then the shadow it casts is rendered correctly (actually its correct even if its a few degrees outside of my FOV). However; when I rotate my head slightly further away from the tree the shadow suddenly disappears; obviously breaking any immersion. Turning my head back slightly toward the tree brings the shadow back.

    Clearly the engine is culling the shadow (or rather the actual tree object) as it has determined that it doesn't need to be rendered, but I still need it to cast a shadow.

    The annoying thing is i had the same issue in a different game a couple of years ago and I did fix it however I can't remember what I did and I've spent the last 2 hours pulling my hair out try to solve this; with no luck.

    I'd be grateful if anyone could point me in the right direction.

    Thanks in advance
     
  2. thep3000

    thep3000

    Unity Technologies

    Joined:
    Aug 9, 2013
    Posts:
    400
    Which version of Unity, which XR Plugin + device, and what render pipeline are you using? There is an optimization to cull only once for both eyes that it is likely related to, but need the above info first to see if we can narrow down where the issue is.