Search Unity

Shadows on water shader

Discussion in 'Shaders' started by Goldenvale, Mar 29, 2015.

  1. Goldenvale

    Goldenvale

    Joined:
    Feb 26, 2015
    Posts:
    86
    I have a water shader that works fine, but the only thing i´m missing is the shadows, it doesn't look too bad without them but it would look beter if there were shadows. Is it possible to render them on a water shader with Unity?

     
  2. echo4papa

    echo4papa

    Joined:
    Mar 26, 2015
    Posts:
    158
    If it's a surface shader adding "addshadow" to the end of your pragma will work.

    Like this:

    Code (CSharp):
    1. #pragma surface surf BlinnPhong vertex:vert addshadow
     
  3. Goldenvale

    Goldenvale

    Joined:
    Feb 26, 2015
    Posts:
    86
    I'm using a fragment shader, so that doesn't work.
     
  4. echo4papa

    echo4papa

    Joined:
    Mar 26, 2015
    Posts:
    158