Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Problem of shadows on water reflections

Discussion in 'Shaders' started by Amenophis-Memnon, Sep 22, 2016.

  1. Amenophis-Memnon

    Amenophis-Memnon

    Joined:
    Sep 22, 2016
    Posts:
    5
    Hi! First sorry for my english.

    I use the "Water Pro" prefab of Unity Standard Assets in my scene. The water reflect my terrain properly but i have some problems with shadows.

    Here everythings is ok :


    But when the moon eclipses the sun...


    How to fix this? The problem is the shader but it's too complicated for my novice level.
     
  2. Namey5

    Namey5

    Joined:
    Jul 5, 2013
    Posts:
    188
    The problem is not the shader, but more likely the camera generated by the script to render the planar reflections. You may have to adjust some settings in the script/add to the script in order to add shadows support for that camera at that distance.
     
  3. Owers

    Owers

    Joined:
    Jul 7, 2012
    Posts:
    39
    It's not a shader issue, it's a bug in Unity 5. Render textures/cameras with custom projection matrices couldn't support real-time shadows properly. Here's an issue ticket based on the problem:
    https://issuetracker.unity3d.com/is...asts-it-when-using-a-custom-projection-matrix

    I've tried this in the Unity 5.5 beta and it has been fixed, so maybe give that a try (make sure to update Standard Assets for 5.5 so that Water Pro is also fixed).
     
  4. Amenophis-Memnon

    Amenophis-Memnon

    Joined:
    Sep 22, 2016
    Posts:
    5
    Thanks for yours answers! I will try the Beta.