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

Water Bug?

Discussion in 'Shaders' started by sebeisdrache, Mar 5, 2015.

  1. sebeisdrache

    sebeisdrache

    Joined:
    Jan 16, 2015
    Posts:
    34
    Hello
    now Unity 5 Is public, so I tested the Water shaders, but the water shader have some strange reflections?

    It seams there is a Ghost reflection.
     

    Attached Files:

  2. jvo3dc

    jvo3dc

    Joined:
    Oct 11, 2013
    Posts:
    1,520
    Ghost reflection often denote that the reflected scene is not properly clipped.

    In other words, it's reflecting something that is under the water.
     
  3. sebeisdrache

    sebeisdrache

    Joined:
    Jan 16, 2015
    Posts:
    34
    how can i fix it?
     
  4. jvo3dc

    jvo3dc

    Joined:
    Oct 11, 2013
    Posts:
    1,520
    Judging from the screenshot, split the geometry above and below water into two separate layer masks. Only render the objects above water in the reflection and only the objects below water in the refraction.
     
  5. sebeisdrache

    sebeisdrache

    Joined:
    Jan 16, 2015
    Posts:
    34
    you mean cutting the terrain into 2 separate meshes?

    The problem is still there if the water only reflects or refracts.
     
  6. jvo3dc

    jvo3dc

    Joined:
    Oct 11, 2013
    Posts:
    1,520
    Split it and only render the parts above the water in the reflection by setting layer masks.

    I also see a clip plane offset. Are you sure that's at the right height? That can also fix things.
     
  7. sebeisdrache

    sebeisdrache

    Joined:
    Jan 16, 2015
    Posts:
    34
    i solved the problem, by using a skybox with my active cameras.