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