Search Unity

Does Unity not bake the shadows anymore?

Discussion in 'Global Illumination' started by Deleted User, Oct 1, 2016.

  1. Deleted User

    Deleted User

    Guest

    I wanted to bake my shadows for my directional light. It used to work in Beast, but this is my first time trying it in Enlighten.

    All it ever seems to "bake" is a blurry dark smudge-like area directly below the objects in my scene. I can't tell if it's a shadow, or just some kind of AO, or just a reflection from the dark bottom-side of my objects, reflecting onto the ground below. I have AO turned off.

    One thing's for sure, if I angle my directional light, and then bake the scene, those dark smudges are always directly below the objects, even though the angle of the light should have created shadows at an angle (because I angled my light).

    I have my general GI set to "directional" lightmaps. All objects in my scene are set to static. Lightmap UV density looks good. I've tried changing every imaginable setting.

    I'm starting to think Unity no longer bakes shadows, and only supports real-time shadows. Can anyone confirm?
     
  2. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,790
    That's not true.

    I am not sure what it is you're describing though, a picture might help (and a picture of your settings perhaps?)
     
  3. Deleted User

    Deleted User

    Guest

    Why is a picture even necessary? It's a blob of darkness right below the object. Doesn't matter what the settings are, I have tried them all. If I sent you a picture of my current settings, you would blame my settings. But I've tested several dozen settings. Been working on this for two days trying settings.

    Anyway but here's the pictures nonetheless:

    This is with realtime shadows (cleared the GI cache):


    And here it is baked:


    Notice the smudge below the tree. Notice it isn't at an angle, even though the light is at an angle.

    As for my settings, you're welcome to suggest a setting that will work. Hard to screenshot my settings, since I've gone through about 20 settings, and they all make this same smudge below the tree(s), only thing that varies slightly is how dark the smudge is, but it's never crisp (it's always very much a smudge), and it's never angled.
     
  4. Deleted User

    Deleted User

    Guest

    Could it be that Unity's GI doesn't cast shadows from objects that are in the alpha-clip queue? Because obviously my tree is using an alpha clip shader.
     
  5. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,790
    They work just fine.

    There is something else wrong, it looks like the light isn't baking at all, even elsewhere on the ground.

    Edit: Test I just did

    cutoffbake.png
     
  6. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,790
    (the light Baking is set to baked, right?)
     
  7. Deleted User

    Deleted User

    Guest

    I had it set to mixed... I'll try another test with it on bake and see.
     
  8. Deleted User

    Deleted User

    Guest

    I switched to baked and there still was no shadows from the tree. But I switched the tree to standard shader, and selected "bake" option in the standard shader, and tried the bake again, and bingo... shadow appeared. So the problem is with my shader, interesting. Now that I know what the problem is I'll be able to fix it. Anyway thanks for the feedback and comments. :)
     
    AcidArrow likes this.
  9. Stardog

    Stardog

    Joined:
    Jun 28, 2010
    Posts:
    1,913
    Please don't be one of those bake shadows on a terrain people.
     
  10. Deleted User

    Deleted User

    Guest

    Ahhh ha ha. Ha ha. Very funny, as if I would ever do something silly like that.
     
  11. Deleted User

    Deleted User

    Guest










    Say hello to baked shadows on thousands of trees.
     
  12. JadsonAlmeida

    JadsonAlmeida

    Joined:
    Jan 30, 2014
    Posts:
    9
    Hey, man! What's up?
    Can you post a print of the tree object and shader setup? Will help us alot!
    Thank you!
     
  13. Deleted User

    Deleted User

    Guest

    @JadsonAlmeida the issue I was having in this thread has been resolved. However, if you are intrested in the trees seen here, they are called LushLOD Trees, available on the asset store for around $10.
     
    JadsonAlmeida likes this.
  14. JadsonAlmeida

    JadsonAlmeida

    Joined:
    Jan 30, 2014
    Posts:
    9
    Thank You!
     
  15. kingkoopa505

    kingkoopa505

    Joined:
    Jul 10, 2017
    Posts:
    5
    What do you mean you selected the "Bake" option in the standard shader? Can you post a pic showing where in the inspector you did this?

    I'm having the same issue where I cant seem to get any shadows to show up once I bake the lights.
     

    Attached Files:

  16. Deleted User

    Deleted User

    Guest

    Uhhhh... I actually wrote this so long ago, I can't remember anymore. But maybe I was using the "Standard (Specular Setup)" shader... it has a baked option. I wish I could tell you for sure if that's what I was using. It's just that I don't tend to remember anything I did more than about a yesterday ago. ;p
     
  17. rolfewiz

    rolfewiz

    Joined:
    Aug 22, 2014
    Posts:
    8
    @kingkoopa505 Are you trying to bake shadows from terrain trees specifically? Unity 5 won't bake terrain tree shadows without some modification.
     
  18. kingkoopa505

    kingkoopa505

    Joined:
    Jul 10, 2017
    Posts:
    5
    I'm trying to just bake general mesh shadows in a room.