Tag Info

Hot answers tagged

74

I tried it. Splashes (springs) As that tutorial mentions, the surface of water is like a wire: If you pull on some point of the wire, the points next to that point will be pulled down too. All points are also attracted back to a baseline. It's basically lots of vertical springs next to each other that pull on each other also. I sketched that in Lua using ...


20

Check out how PixelJunk Shooter did it (including simulation) in this presentation (PDF) at GDC2010.


10

every time I tried to simulate water I just ended up applying a lowpass filter on a texture representing water level. It's very simple to implement but it fails whenever you get massive changes in water level which may generate large waves. In this method there are some places where water always have some constant level, like river ends. in those cases you ...


8

George Duckett's answer is far more direct and really well presented if you need fully-simulated water in your game. For simulated shallow-water physics with minimal accuracy (less realism, more playful), this image gave me an incredible moment of clarity: http://www.patrickmatte.com/stuff/physicsLiquid/


7

You need to check out cellular automata, and possibly fluid dynamics. Tarn Adams implemented a cell based fluids system in Dwarf Fortress, and those are the tools he claimed to use in an interview I read some time back (and also in 3 dimensions as per your use case). I think for your purposes, cellular automata (self-replication/propagation of water cells) ...


4

To add constant waves add a couple of sine-waves after you have calculated dynamics. For simplicity I would make this displacement a graphical effect only and not let it affect the dynamics themselves but you could try both alternatives and see which works out the best. To make the "splashhole" smaller I would suggest altering the method Splash(int index, ...


4

If you're looking to have not a lot of water move over a terrain, then your best bet will likely be some form of Smoothed Particle Hydrodynamics (or SPH). In this formulation, you simulate a set of particles as they adhere to the laws of hydrodynamics (namely, the Navier-Stokes equations). There is a great series of articles written about this from Intel: ...


4

Disclaimer: I haven't heard of a paper describing how From Dust was done, so this is entirely guess-work. A few things I noticed about From Dust: Anything on the landscape is a fluid (notice what happens when you drop a lot of sand at once) - everything just has different viscosities. You never get overhangs (at least on my computer) - this would be a ...


3

While I don't think they'll give you what you're asking for out of the box, you should definitely check out these two classes because they might be able to get you something very close. CCShaky3D & CCRipple3D Play around with those effects and see if you can get close. If you can't, you can always dive deeper into the engine to see how those effects ...


3

It's named Z-fighting. You can google a lot information about it. For example here on wiki. In short: your water and terrain plane are in the same distance from camera (they are coplanar). If you move your camera (direction), float results differ a bit, so sometimes (I mean: some pixels) it chooses water to be drawn, sometimes it chooses terrain. And you ...


3

I cannot say what is commonly used, but my first thought would be to use a particle system with particles of varying sizes representing water of various volumes. The top of the water would use smaller particles to form the undulations of the surface and waves, the water nearest the player would use the smallest particles to simulate splashes and small ...


2

If you were using a voxel-based terrain, you could, in addition to storing the density of ground per voxel, you could also store a water value that is clamped between 0 and 1 - groundDensity. Drawing the water would be as simple as running a marching cubes pass over the water values. Simulating the water would be a little more difficult, but the basic ...


2

For the solution (mathematically speaking you can solve the problem with the solving of differential equations, but im sure they don't do it that way) of creating waves you have 3 possibilities(depending on how detailed it should get): Calculate the waves with the trigonometric functions (most simple and the fastest) Do it like Anko has proposed Solve the ...


2

Except the spluttering / water jets (seems to be done with particles) it looks like a displacement shader. Check out this http://http.developer.nvidia.com/GPUGems2/gpugems2_chapter19.html It is in 3D but the theory behind it should provide helpful if it is that kind of water effect you look for.


2

Grant Kot has put some of his fluid simulation code up on Github with implementations in both javascript (canvas) and C++ with OpenFrameworks: https://github.com/kotsoft He has a few demos up on his youtube account: http://youtu.be/HqWheJSEiaw I have no idea how it works, but I know it runs fast and there's all sorts of variations to build with it. A good ...


1

i dont know unity, but I normally create a model of a river, unwrap it and add a texture then offset its uv coordinates within its shader. this might help: http://answers.unity3d.com/questions/19848/making-textures-scroll-animate-textures.html


1

Check out the blog: http://mediocregames.wordpress.com/ Posts like this might help you: http://mediocregames.wordpress.com/2011/09/08/getting-the-water-flowing/ They are the makers of Sprinkle: http://itunes.apple.com/us/app/sprinkle-water-splashing-fire/id447791438?mt=8 https://play.google.com/store/apps/details?id=com.mediocre.sprinkle&hl=en


1

My game is 2D so I'm using a particle emitter to get a water effect. If you're looking at using a 3d engine see: http://benbritten.com/2009/05/19/fun-with-unity/ The particle emitter I'm using can be found on 71squared. Also see: Top down water view, cocos2d


1

A long time ago, when I was programming similar water simulation, I used this as a source. It's written in C++/OpenGL. You can find there PDF with description and also source codes. You can see, there are faked waves - if you don't want them there, you just don't have to use "noise" textures.


1

I think you need to override the keyPressed virtual method inherited by the Sample_Water class (in Water.h) from SdkSample class. Adding something like the following code in Sample_Water class (Water.h) should help you bool keyPressed( const OIS::KeyEvent &arg ) { //-- Don't process any more keys if dialog is up if ...


1

In my previous company (Touchscape), I did exactly this. The code for the water demo is part of the multitouch sdk sample. we used Ogre3D for graphics. but what specifically will help you is to understand multi-touch interaction with water and how water is simulated (plus the rendering if you are interested). You can download it for free from ...



Only top voted, non community-wiki answers of a minimum length are eligible