Search Unity

[HELP] Expanding a circle for water Ripple effect with flow maps

Discussion in 'Shaders' started by AlexTemina, Oct 14, 2016.

  1. AlexTemina

    AlexTemina

    Joined:
    Feb 19, 2014
    Posts:
    44
    Ok Guys... I've been struggling with this for days and I feel quite desperate.

    I need a ripple effect on water for when an object hits the surface.

    I tried many things, starting for a simple cosine method, but this is not good because you need to keep track of each ripple separately, having then a limit on how many ripples you can make.

    Then I moved to flowmaps, but I'm completely unable to make an effect of a ripple expanding just with a flowmap.

    I'm making a circle when something hits the surface, creating a flowmap like this:



    It's just a circle with red-green for the flow and blue for elevation, even though this last color is not used yet.

    I tried several things, and I thought I was close when I was 'expanding' the uv. The effect worked but only in the center, so I had to keep track of coordinates, which made me go back to the problem of cosine. I actually realized I didn't even need a flowmap then, I was going around in circles.

    Now I'm trying with neighbours. I'm trying to get the color of my neighbour and get the info of my neighbour accordingly. It seems to work well with 1 side only, but now I'm trying to add left and right, and starts to get messy. This is what's happening now:



    It seems it's working, only it smells a bit how borders are... I may not doing things properly.

    This is my shaderforge so far:


    If I add 2 more neighbours for up and down, then it's not working properly anymore. Please, help. I feel very desperate and frustrated... I really don't know why I'm not able to solve this by myself.

    Thanks a lot