Search Unity

Question What is this effect called, underwater distortion?

Discussion in 'General Graphics' started by lmbarns, Jul 24, 2022.

  1. lmbarns

    lmbarns

    Joined:
    Jul 14, 2011
    Posts:
    1,628
    I'm trying to find a modern version of this effect. It was a shader back from Unity 4 that created an underwater effect. I've been searching and searching and can't find anything similar and want to make sure I have my search term correct. If I was to try to search for how to do it with visual effect graph or shader graph what's the term I need to be looking for?

     
  2. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,435
  3. c0d3_m0nk3y

    c0d3_m0nk3y

    Joined:
    Oct 21, 2021
    Posts:
    671
    You wouldn't get a wobbling refraction in an aquarium, though. The wobble effect happens because of waves but there are no waves between the glass and the water. You do get refraction but it's constant.

    As you can see here, the wobble effect only happens at the surface.
    https://mobile.twitter.com/Khena_B/status/1555494129513238528
     
    arkano22 and richardkettlewell like this.
  4. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,058
  5. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    If it is behind glass and uses render texture or buffer, simply scroll a normal map on the glass, like a heat shimmer. This is done by mixing the normal map with UVs.

    Alternatively, in the base vertex shader for underwater things, apply some form of consine math to add to the vertex position before output.

    It doesn't have an official name on account of it being done in mostly 2 ways: distorting texture coordinates or distorting vertex positions. Simple to understand though, and easy to get help with.
     
    lmbarns, Graphics_Dev and DevDunk like this.