Search Unity

No shadow from an directional light...

Discussion in 'Editor & General Support' started by RandAlThor, May 2, 2009.

Thread Status:
Not open for further replies.
  1. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,293
    I have a scene with a directional light and i can see no shadow on my objects.

    I now have only two objects here, a plate and a ball on the plate.
    Both objects send and recieve shadows.

    The directional light use the quality settings in wich i use 4 cascades and the shadow distance 200.
    I allow hard and soft shadows and high resolution.

    I just test shadows with another light, this time a spot light and with this it works but not with the directional light even when i place it near the ball and change intensity and range.

    I also tryed it with lower or no cascade and more or less distance but no luck till now.

    Maybe someone can help?
     
  2. Don-Gray

    Don-Gray

    Joined:
    Mar 18, 2009
    Posts:
    2,278
    A directional light (maybe you already know this) has to have it's direction icon pointing in the direction you wish to have the light cast.
    If you are on a terrain you also have to create a lightmap for the shadows to show.
    And of course you do have the shadows enabled on the directional light, right?
     
    Shamantiks likes this.
  3. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,293
    Yes i know that the rays of the directional lights have to be positinioned.

    I am not an a terrain and the shadow is anabled on the directional light.

    Maybe it will not work with ATI mobility Radion HD 2600 XT from my iMac !?
     
  4. Don-Gray

    Don-Gray

    Joined:
    Mar 18, 2009
    Posts:
    2,278
    Hmmm, sorry, guess I don't know then.
     
  5. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,293
    Any idea!?
     
  6. antenna-tree

    antenna-tree

    Joined:
    Oct 30, 2005
    Posts:
    5,324
    So if you place a spot light in this scene and turn on shadows it works... what happens if you change the light type to Directional in the Inspector?
     
  7. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,293
    Ok, i should have tested this by myself :eek:) but that is not the only thing i am working on.

    I changed the spotlight to a directional light and i can see shadow now.

    But..

    I do not understand the way the spotlight is working correctly.
    I use 3D programms since many years and think of them like a Sun light with parallel light rays (i know that the rays of the sun are more like a point light but the rays that hit the earth are nearly parallel becouse of the distance from the sun to the earth).
    So i can place them anywhere, just have to align the Lightrays to the right direction by rotating them.

    So i have made a skycube and there is a place where the sun light is comming from and i place the light there ((becouse i want to get a lens flare from there) and rotate the lightrays to my scene.
    But now the scene is dark but it should not.

    I can fake the lens flare with another light but the real problem is that i can not rotate the rays to the right direction. It just do not work the way i think it should work.

    Maybe it is better to make short movie so you can see it better.

    Here is the movie:
    http://www.screentoaster.com/watch/stUklSRkVIR11eRVRVU15ZUFJR/unity_directional_light_problem
     
  8. Don-Gray

    Don-Gray

    Joined:
    Mar 18, 2009
    Posts:
    2,278
    You can use a Directional Light with a lens flare for your sunlight object, you only have to have the rotation correct for the flare to show in the right place in the sky. In this scene you can see the flare shows where the sun is in my skybox.
    But, if you aren't getting shadows with the Directional Light, you've got problems.
    You could raise the Directional Light intensity and/or use the ambient light setting in the Render Settings to maybe bring up the scene lighting.

    http://hometime.net/lens_flare.html
     
  9. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,293
    @Don Gray, again it is you. You are kind :eek:)
    But the lens flare is not my real problem.

    I have shadow now but i can not get it from the direction and angle i want.
    It seemed that it is somehow restricted and i do not know why.
     
    BrandyStarbrite likes this.
  10. Don-Gray

    Don-Gray

    Joined:
    Mar 18, 2009
    Posts:
    2,278
    Sorry you are having so much trouble!
    :?

    In my scene the light is in line physically with the area I wish to have it shine from and directionally at the angle I need. This isn't working there?
     
  11. Fortyseven

    Fortyseven

    Joined:
    Mar 5, 2014
    Posts:
    12
    (I know this is a long time ago, but I just had something like this happen to me.)

    My floor was using a VertexLit shader. No shadows. Confusing. Switched back to a Diffuse shader: boom. Shadows. :p
     
  12. elnineo

    elnineo

    Joined:
    Jul 28, 2013
    Posts:
    1
    Hi RandAlThor, I had the same problem .. new scene and only a plan and a ball with a Key and fill lights (both directional). I got the shadows that way : Edit -> Graphics Emulation -> No Emulation :)
     
    games4ever and atgczcl like this.
  13. Josh-Naylor

    Josh-Naylor

    Administrator

    Joined:
    Jul 1, 2014
    Posts:
    216
    How about creating a new thread for this problem. :D
     
Thread Status:
Not open for further replies.