Terrain Shadow Issue in Project Upgraded to 5.0

I’m upgrading my project to Unity 5.0, and I’m now having issues with my terrain as a shadow receiver. Everything was working fine in 4.6.

The test scene is just a simple cube half occluded by a brand new terrain, with another cube in hanging in midair. As you can see, it’s as if the terrain mesh is not being considered in shadowing. No shadows project onto the terrain, and instead project onto geometry occluded by the terrain, though the shadows on that occluded geometry are being drawn on top of the terrain. I’m using the “Built In Standard” terrain material.

I managed to reproduce this behavior in a minimal scene using a brand new Terrain asset in my current project, but when I exported the scene to a new project, everything was fine. This was leading me to believe it is an issue with a project-level setting, though I could not find any significant differences in settings between projects.

So, seeing how using a brand new project seemed to correct the issue, I went for a Hail Mary and exported ALL assets from my current project, then imported them into a blank project (that was painful >.<). When I opened my minimal test scene, the shadows were still behaving incorrectly in this new project.

The shadows also work correctly if I change from the “Built In Standard” material to a custom material, but then I obviously lose all of the terrain multitexturing goodness. “Built In Legacy Specular” has the same shadow problem, and “Built In Legacy Diffuse” does not seem to work and draws a magenta mess.

The behavior in a built Windows .exe is different. When I build and run, the terrain acts like it is 100% in shadow all of the time. Very strange.

I’m out of ideas at the moment. I’ll go with the “Built-In Legacy Diffuse” for now, but it would be nice to have this working using the new Material Based Shading goodness.

Anyone have any idea what could be going on? For reference, here is what my test scene should look like:

It turns out the problem was that I was overriding the default terrain shaders as part of a solution to allow holes in terrain. Once the overriding shaders were removed and Unity restarted, everything started working as it should.

Now I just need a new solution for holes in terrain :frowning: