I have been using the ofxFX addon and it’s water ripple effect.
I am now wondering how to change the shader code to ignore the edges.
Basically it should think the space continues to the sides and NOT create reflections of the edges.
I tried to set the dampening for the edge pixels to 0 but it creates a reflection of “black pixels”.
@patricio do you think it is possible to make the ripples die at the edges?
It has to do with the fact that every pixel’s ‘displacement/color/height’ value (what makes the actual ripple effect) is based upon the neighboring pixels. Basically the algorithm is that for every pixel, the ‘acceleration’ value is the average difference between its neighboring pixels ‘height’ value and the current pixels ‘height’ value.
And then the pixels ‘velocity’ value += acceleration, and then the height value += velocity. and theres some other differential equations trickery to reduce the number of operations by storing the previous height values in another buffer and then using (current height) - (previous height) = current velocity. But thats the general idea.
So the point of (poorly) explaining that was essentially to say that its a different algorithm you must use in order to unclamp the edges. What ive done in my ripple simulations is basically damp the wave gradually as it reaches the edges, using some easing function. I do this by storing an array of damping values and then multiplying by the height values pointwise (set values in the range 0-1).
This post is from a while ago, and I still have not quite figured out how to solve for the unbounded constraints. let me know if you have figured anything out
By using a different method I was able to get my waves