The procedural examples linked above has the sinus modifier, if you have a budget you may also want to look at MegaFiers which has ripple and wave modifiers as well as a dynamic water ripple modifier.
You can essentially do a 2D fluid solver ( solving it for a plane, based on a height map ). This can be done on the CPU just fine, though I’d recommend doing it on the GPU which might be an issue on the indie version without render targets. In essence, use verlet integration and make sure the boundary conditions are stable; apply damping as needed.
It’s trivial to extend this technique to a 2D mesh or bitmap animation. Also, there are dozens of examples available on the net, it’s really not hard to find good code samples that will give you efficient solutions for the 2D case.
If anyone’s interested, I’ve also coded a 2D Navier-Stokes fluid solver (incompressible case). Originally coded in HLSL, it should be possible to port it to ShaderLab.
I have water surface in my 3D world, I want the water to generate the ripples with the player touches it, or shoots towards the water, the bullet collided with the water and creates ripple, and if the player gets an object from the shallow water, I want the ripples to be generated when the object is pulled outside the water. I know its a lot of wants, but have been trying so many ways to create this effect.
I found the ripple test here… http://benbritten.com/2009/05/19/fun-with-unity/ … but this is for mouse pointer click, I added rigid body and added collision to both the object and create a trigger function to generate ripples… I thought I was on track with getting it work, but nope… not working… !!
Basically, you compute the cross-section of the object intersecting with the water’s surface plane and then modify the height and velocity of each vertex (or pixel) in the water simulation that intersects the cross-section region to match the displacement and velocity of the object. That change in height and velocity is what powers the simulation. This is relatively easy if you’re talking about simple convex primitives that have easily-determined cross sections (sphere, cone, cube, cylinder).
You are on the right track. I’ll note that there’s a lot of aliasing in his simulation, this is mostly due to the way that it seeds the heightmap. He’s not taking care to feather the pixels around the point where the user clicks, he just sets them to a hard height…
So essentially what you would do here is replace this method with one that fills in an area that matches the cross-section of the object that’s floating in the water. But you do want to take care to feather or anti-alias the edges so that you’re not just setting all of the pixels to a static value which is going to cause those ugly aliasing effects to propagate in the wave, which simply looks unnatural.
How do I do that for a Plane? I am using Daylight water from Unity Pro, and want to add this effect to the daylight water. And since its a plan object, I tried storing the plans vertices in a 2D array and process ripples. But I keep getting an error “Failed to created slat-texture”. The game runs normally, but this error is generated per frame.