Search Unity

Shadows casting incorrectly after building

Discussion in 'Editor & General Support' started by Collett, Nov 3, 2015.

  1. Collett

    Collett

    Joined:
    Feb 17, 2015
    Posts:
    13
    I'm having a weird issue where everything in my scene seems to be casting its shadow at an incorrect place (as seen in Screenshot1), but this only seems to be happening after a build. Inside the editor the preview is fine (as seen in Screenshot2). Has anyone seen this before? Or have any ideas on how to fix it?

    I actually originally thought everything in my scene was floating/hovering because of the way the shadows are casting, but after closer inspection it seems like its just a shadow issue.

    Weirdly enough I have two levels doing this, and two that are completely fine. And I've built them all in exactly the same way (as far as I know!).
     

    Attached Files:

  2. Giometric

    Giometric

    Joined:
    Dec 20, 2011
    Posts:
    170
  3. Collett

    Collett

    Joined:
    Feb 17, 2015
    Posts:
    13
    Yes, its using Terrain. The weird thing in my case is that I have two levels that I've built in exactly the same way and they don't have the issue....

    I'll try a couple of the steps you've mentioned on that thread and report back!
     
  4. Collett

    Collett

    Joined:
    Feb 17, 2015
    Posts:
    13
    No luck disabling static mesh optimisation :( But I did spot something else that Huruk_an mentioned on the other thread. If you look near the bottom of the attached pic (Screenshot3) I've circled an asset that I dragged under the ground, and you can actually see the shadow on the surface?! Very weird.
     

    Attached Files:

  5. Giometric

    Giometric

    Joined:
    Dec 20, 2011
    Posts:
    170
    Yeah, it kind of looks like everything is casting shadows on the terrain as if it were several meters higher than it actually is. Have you also tried replacing the terrain with just a normal mesh (even a flat plane will work, just for testing), to see if the shadows come out right then? It could narrow the problem down to being either with the terrains or with shadow casting in general.

    As I mentioned in the other thread, this is probably worth submitting a bug report for, if you can. Especially since now that's two different projects with the exact same issue.
     
  6. Collett

    Collett

    Joined:
    Feb 17, 2015
    Posts:
    13
    I've found a possible solution. If you select the terrain, go to Terrain Settings -> Base Terrain -> Change 'Material' from 'Built in Standard' to 'Built in Legacy Diffuse'.

    The shadows look fine now :)

    Ill post this on the other thread to see if it fixes Huruk_an's issue too.
     
  7. Giometric

    Giometric

    Joined:
    Dec 20, 2011
    Posts:
    170
    Nice! Sounds like it is a problem specific to Terrains after all. Glad you were able to find a workaround.