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.
  2. Dismiss Notice

Real time shadows only casted on objects no terrain

Discussion in 'Universal Render Pipeline' started by Ranama, Apr 8, 2020.

  1. Ranama

    Ranama

    Joined:
    Apr 3, 2020
    Posts:
    2
    I am making a game and I am using a character as the player character.
    I am using Universal render pipeline and the real time shadow of the character is only casting on objects, such as cubes and similar and not on my terrain.
    • The terrain is using the "Univeral Render Pipeline/Terrain/Lit" shader.
    • I have painted the terrain with some textures.
    • I am using Lighting Mode "Subtractive" on the terrain.

    On the objects that the cast shadow is working I am using custom made PBR graph shaders and plain materials.

    Here is a picture of how the shadow looks like on objects and you can see that it's invisible on the terrain:
    https://i.imgur.com/Yp4rt7f.png


    I am happy for all the help I can get if some more info is required, please let me know, thank you.
     
  2. erikabar

    erikabar

    Unity Technologies

    Joined:
    Jan 26, 2017
    Posts:
    36
    Hey @Ranama! What Universal RP version are you on? I just tried reproducing it by simply creating a new terrain, paint it, set the Lighting Mode to Subtractive, create a simple PBR graph - had no luck so far.
    Would be useful if you report a bug and attach a minimal project with your terrain and custom PBG graphs so we could investigate
     
    S_Dave likes this.
  3. Ranama

    Ranama

    Joined:
    Apr 3, 2020
    Posts:
    2
    @erikabar Thank you for the answer, I do not know what happened but I think it was something to do with changing a old project to universal renderer pipline and I also think I maybe created some custom renderer following a youtube tutorial but I do not really know what made the bug.

    Now I created a totally new project and moved everything over there and shadows seems to be working fine again.
     
    PentaGame and erikabar like this.
  4. Haedrian

    Haedrian

    Joined:
    May 4, 2014
    Posts:
    4
    I'm having the same issue, and I discovered that if I start a new project, and "convert" it to use the URP - this issue occurs, but if I start off by creating a Universal Project, then it works perfectly fine.

    Is there some sort of setting that's being set automatically for instance?
     
  5. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,134
    I'm fairly sure this is a bug that was introduced in URP 7.2.0.

    Setting the Shadow Cascades option in the pipeline setting to "Two Cascades" (or 4) always fixes this for me. Apparently, the terrain shader doesn't receive shadows unless shadow cascades are used.
     
  6. jjiangweilan

    jjiangweilan

    Joined:
    Mar 31, 2018
    Posts:
    19
    same issue here, after upgrading to the newest version
     
  7. NOT_Lonely

    NOT_Lonely

    Joined:
    Feb 2, 2013
    Posts:
    483
    I have the same problem. I upgraded my project to from 2019.3.5 to 2019.3.13 and my terrain stop receive shadows.
     
  8. LtClifforth

    LtClifforth

    Joined:
    Jun 3, 2020
    Posts:
    1
  9. Shaunyowns

    Shaunyowns

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    328
    I'll chase this up to get this confirmed, do you mind filing a bug report on this as well?
     
    rv0000s likes this.
  10. rv0000s

    rv0000s

    Joined:
    Feb 18, 2014
    Posts:
    5
    Yup, Shadows don't work when shadows are set to no Cascades in URP. Thanks @StaggartCreations for finding this out.
     
  11. Super_Solomob422

    Super_Solomob422

    Joined:
    Jul 7, 2019
    Posts:
    7
    Can't seem to find the shadow cascade settings, I just started using URP after a while of using unity without knowing of it's existence somehow. As such, sorry if it's painfully obvious.

    Edit: Aye. Never mind, found it. Though i do wonder what possibly causes this. I had taken 3 hours on this, before I linked it to just converting to URP. For others who have just started using this. Just click on the UniversalRenderPipelineAsset in your project asset view, and the settings should come up in the inspector. It's under shadows.
     
    Last edited: Jun 19, 2020
  12. JohnnyFactor

    JohnnyFactor

    Joined:
    May 18, 2018
    Posts:
    343
    This is occurring with Built-In Render Pipeline too, even with a fresh 2019.4 project.
     
  13. JohnnyFactor

    JohnnyFactor

    Joined:
    May 18, 2018
    Posts:
    343
  14. Super_Solomob422

    Super_Solomob422

    Joined:
    Jul 7, 2019
    Posts:
    7
    It was for you? I would have no idea how one would fix that. I would still try messing with the shadow settings and seeing if that works. Best of luck to you on finding a fix!
     
  15. JohnnyFactor

    JohnnyFactor

    Joined:
    May 18, 2018
    Posts:
    343
    The shadow cascade solution has stopped working for me. now it's "stable fit" that fixes it, but only with orthographic cameras.
     
  16. JohnnyFactor

    JohnnyFactor

    Joined:
    May 18, 2018
    Posts:
    343
  17. tealm

    tealm

    Joined:
    Feb 4, 2014
    Posts:
    108
    Is there no planned fix for this bug in LTS 2019?
     
    Jesper-Nielsen likes this.
  18. SergioAGomez92

    SergioAGomez92

    Joined:
    Jul 3, 2020
    Posts:
    8
    Worked for me, thanks you

    I also unchecked the Baked Global Illumination box in Lighting Settings
     
    P_Jong likes this.
  19. DerDicke

    DerDicke

    Joined:
    Jun 30, 2015
    Posts:
    291
    Still there in 2021.1. Build In.
     
  20. DerDicke

    DerDicke

    Joined:
    Jun 30, 2015
    Posts:
    291
    Found something. I think it is not a rendering bug, but a communications problem inside Unity Editor. If you open Project Settings/Quality and change anything (and change it back), the error goes away and you will have shadows inside Scene and Game Window again.
     
    Last edited: Jul 2, 2022
  21. hydrix

    hydrix

    Joined:
    Apr 30, 2016
    Posts:
    10
    dropping by from Google to say that the default shadow distance in URP is 50, which can make it appear like there's no shadows at all if you're zoomed out even a little bit. The new "shadow distance" setting is under the Universal Render Pipeline Asset -> Shadows now rather than project settings