Real time shadows only casted on objects no terrain

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:

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

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

1 Like

@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.

2 Likes

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?

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.

10 Likes

same issue here, after upgrading to the newest version

I have the same problem. I upgraded my project to from 2019.3.5 to 2019.3.13 and my terrain stop receive shadows.

@StaggartCreations
Thanks, it worked for me.

I’ll chase this up to get this confirmed, do you mind filing a bug report on this as well?

1 Like

Yup, Shadows don’t work when shadows are set to no Cascades in URP. Thanks @StaggartCreations for finding this out.

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.

This is occurring with Built-In Render Pipeline too, even with a fresh 2019.4 project.

@Shaunyowns Bug report #1257896 filed.

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!

The shadow cascade solution has stopped working for me. now it’s “stable fit” that fixes it, but only with orthographic cameras.

Bug is now in the Issue Tracker.

__https://issuetracker.unity3d.com/issues/instanced-terrain-shadows-are-flickering-when-no-shadow-cascades-and-close-fit-shadow-projection-are-used-and-camera-is-moving__

Is there no planned fix for this bug in LTS 2019?

1 Like

Worked for me, thanks you

I also unchecked the Baked Global Illumination box in Lighting Settings

1 Like

Still there in 2021.1. Build In.

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.