Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Is there no self shadowing with spotlights??

Discussion in 'General Discussion' started by tmr2, Nov 6, 2019.

  1. tmr2

    tmr2

    Joined:
    Oct 27, 2019
    Posts:
    53
    Is this not a feature? I can get self shadowing with directional lights, but not with spot lights?.
    (I'm using the forward renderer)
     
  2. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    18,555
    There are limitations to the forward renderer that are not present in the deferred and vice versa. I wasn't able to find a direct statement that this is the result of that but I'm willing to bet that's what the problem is.

    https://docs.unity3d.com/Manual/RenderingPaths.html
     
    Joe-Censored likes this.
  3. frosted

    frosted

    Joined:
    Jan 17, 2014
    Posts:
    3,998
    I think that generally point and spot lights require a shader with "fullforwardshadows" to render dynamic shadows in forward. I don't know which shaders have that flag or how needed it is anymore. I thought that was 'stock' in the standard shader for the last few years but I don't remember exactly. Most of my work is with deferred.
     
  4. tmr2

    tmr2

    Joined:
    Oct 27, 2019
    Posts:
    53
    It's not that the cast shadows aren't working, it's just that single meshes don't cast spotlights shadows on themselves (self-shadowing). Directional lights work perfectly.
     
  5. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    It does for me atleast, forward rendering, shadowmask with mixed mode spotlight

    shadow.jpg

    Mixed mode point light
    point.jpg
     
    tmr2 likes this.
  6. tmr2

    tmr2

    Joined:
    Oct 27, 2019
    Posts:
    53
    Ok, thanks. I will try this.
    What version were you using?
     
  7. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    Above is 2017.4.33 I think, haven't gotten around to bake my scenes in 2019 yet, baking is a bitch :) but if it doesnt work in 2019 then it's one of those regressions unity are famous for :) I can try tomorrow on 2019.2.11 juts turned off my workstation.
     
  8. tmr2

    tmr2

    Joined:
    Oct 27, 2019
    Posts:
    53
    I was using 2018.
     
  9. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    Well, F*** me sideways let me turn on my workstation again :p give me a sec
     
  10. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    Works in 2019.2.11 too

    upload_2019-11-8_0-8-35.png