Waves in simple water

Hello!

Is there any way to creat waves in unity free version?

And if yes how?

I heard about SinusCurveModifier… where can I get it? Where shall I add it? Does it works in unity free?

Sorry for does lots of questions :S I hope you can help me :S

Thanks in advance,
topastop

maybe this can help Procedural Examples | Tutorial Projects | Unity Asset Store

Actually what I am looking for is waves in order to create a ocean.

But thanks anyway :smile:

I am waiting for more answers…

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.

Crumple mesh modifier
A mesh deformed by Perlin Noise
Sinus curve modifier
A mesh deformed by Sinus functions

take a little effort to read :wink:

I have seen water plugins that do ocean, if you search the forums or asset store you should find it.

It’s done =)

I have created the prefab, if anyone wants it just say it down there =)

you found out how to make waves

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.

How did you do it… ? I have been trying to get waves to the Unity free simple water since a month…?? Please Help.!
Thanks,

I posted a simple 1D example here:
http://forum.unity3d.com/threads/141925-2d-Water

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.

How do I make it work for a 3D environment? I want the water ripples created when any object collides with the surface…???

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… !!

Thanks in advance…

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…

void splashAtPoint(int x, int y) {
	int position = ((y * (cols + 1)) + x);
	buffer1[position] = splashForce;
    buffer1[position - 1] = splashForce;
	buffer1[position + 1] = splashForce;
	buffer1[position + (cols + 1)] = splashForce;
	buffer1[position + (cols + 1) + 1] = splashForce;
	buffer1[position + (cols + 1) - 1] = splashForce;
	buffer1[position - (cols + 1)] = splashForce;
	buffer1[position - (cols + 1) + 1] = splashForce;
	buffer1[position - (cols + 1) - 1] = splashForce;
}

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.