Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

No Shadows on Terrain

Discussion in 'Editor & General Support' started by 001visualizer, Jan 4, 2009.

  1. 001visualizer

    001visualizer

    Joined:
    Aug 24, 2008
    Posts:
    113
    Mostly the first impression in Unity3D is, "why doesn't work it as it should?"

    Example: Shadowing with a Directional light:

    >The Cube casts shadow to the Plane but not to the Terrain
    >The Heron doesn't cast any shadow, even not to the Plane.

    Do you have an idea why?
     

    Attached Files:

  2. Aras

    Aras

    Unity Technologies

    Joined:
    Nov 7, 2005
    Posts:
    4,770
    By default terrain does not cast/receive shadows. Switch it's lighting mode to Pixel in the terrain settings tab: http://unity3d.com/support/documentation/Components/terrain-OtherSettings.html

    I suspect the Heron's shader does not have support for casting shadows. Whether something casts or receives shadows is up to the shader that is used. Probably Heron uses some custom shader and whoever wrote the shader did not implement shadow casting bits.
     
  3. 001visualizer

    001visualizer

    Joined:
    Aug 24, 2008
    Posts:
    113
    Hi

    Look at the screenshot. Pixel lighting is on. But that cube casts no shadwo. It has a simple diffuse shader with a textur on it.

    Does terrain support realtime shadow anyway?

    Roman
     

    Attached Files:

  4. LDiederich

    LDiederich

    Joined:
    Jan 5, 2009
    Posts:
    15
    Hi,

    i dont know what a Unity version did you use, but i think realtime shadows are working in unity pro only.

    Lars
     
  5. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    If you have Unity 2.1+ then shadows are supported on terrain.

    One thing to take into consideration is the quality settings: Default is good, that should show some shadows but with restricted casting distance.
    Lower won't show it. Also check if you have set an emulation.
     
  6. defmech

    defmech

    Joined:
    Feb 24, 2007
    Posts:
    506
    Simple suggestion, make sure you're working with the latest version of Unity! I stayed on 2.0 for way too long before I remembered to update.
     
  7. markasuter

    markasuter

    Joined:
    May 20, 2019
    Posts:
    22
    If anyone else has this problem, I solved it this way:
    In the tree prefab that the terrain editor uses, I set the leaves material of the tree to Opaque, and got no shadow. But if I also enabled the alpha clipping and slide it back and forth to any value, THEN I got shadows as expected. Odd.
     
  8. lejean

    lejean

    Joined:
    Jul 4, 2013
    Posts:
    383
    Seeing as this post is from 2009 I doubt it has anything to do with your solution. :D