Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

Problem with shadows

Discussion in 'Editor & General Support' started by Huruk_an, Nov 2, 2015.

  1. Huruk_an

    Huruk_an

    Joined:
    Oct 3, 2015
    Posts:
    24
    Hi !

    I have some problems with shadows in my project. I attached a pic. In fact, my shadows are below the floor, like a reflection in water... And I can see through some textures.
    On my scene I have interlocked some rocks to create the rock wall.

    What is the pb ^^ ?

    Thx ;) !
     

    Attached Files:

    • 123.jpg
      123.jpg
      File size:
      811.3 KB
      Views:
      737
    Last edited: Nov 2, 2015
  2. Huruk_an

    Huruk_an

    Joined:
    Oct 3, 2015
    Posts:
    24
    I tell that the shadows are ok when I start the scene in Unity. The bug appears when I build my scene.
     
  3. Giometric

    Giometric

    Joined:
    Dec 20, 2011
    Posts:
    170
    Might be a quality setting difference between your editor and player. Have you checked to make sure those are the same?
     
  4. Huruk_an

    Huruk_an

    Joined:
    Oct 3, 2015
    Posts:
    24
    Thx for your answer Giometric. Yes they are the same :/
     
  5. Giometric

    Giometric

    Joined:
    Dec 20, 2011
    Posts:
    170
    Can you post a screenshot of what it looks like in-Editor (and preferably from that same camera location)? Going from the screenshot you've posted, it doesn't look like a shadow precision issue to me, but maybe somehow that's what it is; it could be that tuning your camera settings will help. In particular, reducing the amount of precision required, either by increasing the near clip plane on the camera or decreasing the far clip plane, could help the shadows look better.

    If that doesn't work, and this is kind of a long shot, try disabling static mesh batching/optimization in your build settings. It's the only other thing I can think of that would change the meshes in a way that could affect shadow rendering. It shouldn't have any visible effect, but it's possible there's a bug there or something.
     
  6. Huruk_an

    Huruk_an

    Joined:
    Oct 3, 2015
    Posts:
    24
    It doesn't work :/. When I disabling static batching in build settings, the shadows of the rocks disappear totaly in the built scene but not the shadows of plants and trees. I don't understand anything ^^ !

    But I gotta feeling that the shadows, in my first pic, are in fact the base of rocks which are below the ground. I don t know if I am clear... the rocks are sunk in the ground, and I think that what we can take like shadows in my first pic are in reality the base of rocks.
     

    Attached Files:

    Last edited: Nov 2, 2015
  7. Giometric

    Giometric

    Joined:
    Dec 20, 2011
    Posts:
    170
    Yeah, I see what you mean. That might just be a coincidence from the light angle/etc, but maybe there's something going wrong with the terrain's reception of shadows?

    Try replacing that terrain with just a simple flat Plane object, and see if in the build the shadows look how they're supposed to. If they do look correct on a normal Plane, then whatever the issue is must be related to Terrains, but I wouldn't have any idea how to fix it. If you're able to, it might be worth submitting a bug report.
     
  8. Huruk_an

    Huruk_an

    Joined:
    Oct 3, 2015
    Posts:
    24
    Yes it's the same... Except that there is only the shadows of the plants wich are visible. And I cann see through the texture of snow on the rocks for exemple. It's not the first time I meet this pb.
     
  9. Collett

    Collett

    Joined:
    Feb 17, 2015
    Posts:
    13
    Huruk_an, I've been struggling with a similar issue today and I've just this second fixed it! Or found a workaround....

    If you select the terrain, go to Terrain Settings -> Base Terrain -> Change 'Material' from 'Built in Standard' to 'Built in Legacy Diffuse'.

    Let me know if this works for you!
     
  10. Huruk_an

    Huruk_an

    Joined:
    Oct 3, 2015
    Posts:
    24
    hooooo thank you Collett :) ! I used a specular shader I've created but I will try your solution and I tell you if it work ;) !
     
  11. Huruk_an

    Huruk_an

    Joined:
    Oct 3, 2015
    Posts:
    24
    It work Collett :) !! Thx you very much !!! I have to pay you a drink :p !!
     
  12. Huruk_an

    Huruk_an

    Joined:
    Oct 3, 2015
    Posts:
    24
    Giometric you are welcome ;) !
     
  13. Collett

    Collett

    Joined:
    Feb 17, 2015
    Posts:
    13
    No worries, glad I could help! :)
     
  14. Huruk_an

    Huruk_an

    Joined:
    Oct 3, 2015
    Posts:
    24
    Arf... After building my scene at the end of my work, I have finally kept the problem... I can see through the texture of snow on my rocks... F*** !!!