This was a quick test of a mesh deformation script to simulate water. You can read more details and get the code here: http://www.youtube.com/watch?v=OaFfCJwniIM http://benbritten.com/blog/2009/05/19/fun-with-unity/ Have fun !
Hey, that's mine! Thanks for all the nice comments! You can read about it on my blog (the link at the top, by destroyerhst) but it was really a very simple algorithm. And the code is all there too, so go big! Cheers! -Ben
I'm thinking this could actually be modified to generate large impact waves on terrain (ie - when an asteroid hits..or any blast wave, for that matter). You'd just need to sample the terrain heigth at each step and make sure the wave's height doesn't exceed the wave height relative to the terrain heigth at the center of impact. That way, it would travel over uneven terrain realistically. Throw in a particle emitter that expands with the wave (there'd be only one) to handle the ejecta, and you might be able to create some Armageddon/Deep Impact (and any other silly asteroid-killing-the-Earth movie) effects.
Hey Ben ;-) http://workflow.cd-cologne.de/download/unity/webfish.html her's also a small preliminary demo of the fishes (no interaction yet with the fishes). I think that specially for water-ripples it would be better to use a texture and feed it back in the refraction channel of the shader instead of the physical deformation of the plane... At least for the pro version ;-) Was away for two weeks (hollydays ;-) - will contact you later this week... Cheers, Sandor
Nice. I've used that algorithm before myself, and you can make the waves reflect off of any surface; not just the boundaries of the simulation rectangle: http://runevision.com/3d/anims/#45 The trick is to simply not perform the simulation for cells that are outside the body of water (they should keep a value of 0 and not be affected by neighbors). Then the rest works all by itself. (This is the same thing that happens for the rectangle edges.) Rune
thanks bigkahuna ;-) I will post some more things regarding the fishes when they are finished (i will have to finish the project in august). The point is that it is a MultiTouch application (using TUIO) an it will run on our tables... Also the fishes will react if you are touching them. Will post some videos here also... Rune: that's freaking awesome man! Would it be possible for you to extend Ben's code? I think that it would be a very nice enhancement for this community...
I know this is old ,but just cant help to say how great it is and here is the JS version I ported, in case some one needed. I did some small modification so the water ripple is more look realistic ( multiple ripples). here is the video that I apply effect to my multitouch screen: http://www.youtube.com/watch?v=AycJOOoBqj4
Now make a parallax map for that stone texture, add some caustics from the ripples and you've got one awesome puddle simulator
Hey patchfactory, looking nice the video What exactly did you changed in the code - you are saying "multiple ripples" - or do you mean you are creating multiple ripples (multitouch)? Cheers Keep it up,
Ok, the thing is simple, in real world, when you drop something into water, normally there will multiple rings, so I simply add few more rings after one click. how simple is that. LOL
Does anyone know how I could apply this affect to a sphere mesh? I think the trickiest things are sorting out the order of the vertices, and making it wrap around as opposed to bouncing off the supposed edges.
I wonder what kind of texture / shader works best for creating a transparency water effect with Bens code. Like the one in the fish demo (what looks great!). Any idea?
looks to me you followed NeHe's tutorials on this? (could be wrong) but I used the same effect several years ago (with the help of NeHe's tutorials) but could never get a reflection to work on the watter with the ripples so I stopped working on a custom OpenGL engine (was just for fun/learning purposes)
hi all, any of you know how to get this shader for water? http://workflow.cd-cologne.de/download/unity/webfish.html
Hello to all, Can someone suggest me how i can give ripple effect to water when some object collide with that water plane on which there is some texture of water? Thanks.
I could def use something like this on my atlantis stage, where there is a huge ocean and I would want rippling when the characters colliding into it...
Can someone modify the code to allow ripple from collision of rigidbody/collider game objects? Thanks!
Ok, got this function to work...kinda...weird anomaly of water "mounding" in one spot and all the ripples seem to originate from that point...hmmmm Any thoughts?
I've been playing with this code a bit, and it works great, just what I wanted. One thing I can't figure out, is how to change the frequency of the wave. The wave is very low frequency as is, and I'd like to increase it, but don't see any variable that affects frequency.
hey man, sorry for the silly question...I'm tryng to use your script, but where should I connect it? a piano, camera? thx