Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Help with ripple effect in game Lurking

Discussion in 'General Discussion' started by Sezerza, Nov 24, 2014.

  1. Sezerza

    Sezerza

    Joined:
    Aug 9, 2013
    Posts:
    27
    I was looking through some games made with Unity and found this game "Lurking".



    I am very curious as to how they were able to achieve the ripple effect from making noise.

    Any insight would be much appreciated! Thanks~
     
  2. SunnyChow

    SunnyChow

    Joined:
    Jun 6, 2013
    Posts:
    360
  3. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    8,194
    I'm guessing they adapted a decal system or wrote a shader that could project the ripple effect in 3D space. I think it's possible to use 3D textures and this could be an ideal way to draw the effect in a 3d space.
     
    Merman likes this.
  4. Sezerza

    Sezerza

    Joined:
    Aug 9, 2013
    Posts:
    27
    Very cool effect. I hadn't seen this one before. Thanks for sharing!

    I managed to get a similar effect with a basic projection shader I found online, however I can't make it 'crawl' up walls like it does in these games. As I expand the orthographic view on the projector to 'grow' the wave, it simply jumps to the top of walls, ergo the entire side of the wall is lit up.
    Any ideas on how to make it 'crawl' up the walls instead?
     
  5. Merman

    Merman

    Joined:
    Nov 16, 2014
    Posts:
    51
    Perhaps you could use an animated texture where the wave appears to grow, rather than altering your projector.
     
  6. Sezerza

    Sezerza

    Joined:
    Aug 9, 2013
    Posts:
    27
    Hmm, maybe that'd work. Animated Textures are a strictly Unity Pro feature, right? Is a workaround for this possible, or would I need to get my hands on a pro version to test this?

    EDIT:
    After searching around some more I found this thread here on the forums.
    http://forum.unity3d.com/threads/fo...ning-fork-a-game-exploring-sound-wave.181426/

    Unfortunately, I'm not quite that savvy on shaders. If anyone could explain what he said, but even simpler, or with examples, that'd be awesome.

    I'm still interested in exploring this other method with the animated texture as well though.
     
  7. Merman

    Merman

    Joined:
    Nov 16, 2014
    Posts:
    51
    @Sezerza There are workarounds for animated textures in the free version of Unity. I've seen at least two different scripts for it, if I remember correctly. At least one of those two was definitely written in Javascript, but I'm pretty sure there weren't too many lines of code and that it would be relatively easy to rewrite them in C# if necessary.

    I don't have links, but a quick query on your search engine of choice should turn up something along these lines.
     
    Last edited: Mar 15, 2016
  8. Neoku

    Neoku

    Joined:
    Oct 27, 2014
    Posts:
    261
    You can try this, use invisible spheres in the center of the ripple and animate size, then calculate 3 points of the intersection with all surfaces and draw a procedural circle (with the 3 points in common) texture in a mask channel that show a second shader as glow.
     
    Merman likes this.
  9. Merman

    Merman

    Joined:
    Nov 16, 2014
    Posts:
    51
    @Sezerza I believe that doing something along these lines would allow for collision checking.
    Using animated textures and projectors would not allow it, as far as I know.

    (Don't know if you'd even want or need collision detection, but at least this might provide that option.)
     
  10. Sezerza

    Sezerza

    Joined:
    Aug 9, 2013
    Posts:
    27
    Ahh, that sounds awesome. I'll definitely try implementing that @Neoku.
    However, wouldn't you run into problems when the sphere hit the ceiling?

    Thanks for so much response guys!
     
  11. CaoMengde777

    CaoMengde777

    Joined:
    Nov 5, 2013
    Posts:
    813
    just a guess... its actually spheres that are being scaled up, it appears the way it does, because theyre using edge detect filter...
    .. dont know much, just a guess.. seems like itd work.. maybe not work amazingly though... dunno
     
  12. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    8,194
  13. Neoku

    Neoku

    Joined:
    Oct 27, 2014
    Posts:
    261
  14. imaginaryhuman

    imaginaryhuman

    Joined:
    Mar 21, 2010
    Posts:
    5,834
    Looks to me like a simple custom shader, where it calculates the distance from the pixel to the player, ie like a sphere, and then animates the radius of that sphere to move the curved lines outward.
     
  15. Aiursrage2k

    Aiursrage2k

    Joined:
    Nov 1, 2009
    Posts:
    4,835
    Looks like some sort of edge shader.