Search Unity

Methods for water reflection

Discussion in 'General Graphics' started by Muku, Jun 30, 2015.

  1. Muku

    Muku

    Joined:
    Jan 13, 2014
    Posts:
    13
    I am wondering if anyone knows different methods of achieving the look of light reflecting off the water onto the hull of a pirate ship in mobile development.
    We have ideas about the methods to use but none seem overtly efficient and due to time limitations we can only test so many.
    I cant find a picture of it but its the effect of the light bouncing off the waves and giving that wobbly pattern look to the hull of the ship.

    Thanks
     
  2. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Directional blend a texture - you'd need to generate the uvs from a vector though. Alternatively you could merely planar map the ship from below and store the uv in the second channel. The texture for caustic blended over the main texture would then use these uvs instead. This is the simplest approach.

    If shaders aren't your thing and you get super stuck, you can consider just cloning the ship's hull and rendering it on top as a transparent object with its own caustic animated texture. It would still perform pretty well especially if there's not many ships requiring it at one time on screen.
     
    theANMATOR2b likes this.
  3. Muku

    Muku

    Joined:
    Jan 13, 2014
    Posts:
    13
    Perfect, thanks hippocoder!

    Would you have any advice on achieving the stretch and retract pattern on the texture?
     
    Last edited: Jun 30, 2015
  4. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    well caustic reflections don't typically stretch and retract, but you can get a great effect simply scrolling one or two layers opposite each other with the tiling higher on one of them, using additive blending...

    Alternatively you'd need some sort of per vertex uv ripple shader.
     
  5. Muku

    Muku

    Joined:
    Jan 13, 2014
    Posts:
    13
    What about a light that uses a cookie to project that effect onto the boat. Are you able to animate cookies on lights?
     
  6. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    This might help also.
    Caustic shader link at the bottom of the page.