
Introduction to Position Based Fluids - choult
http://physxinfo.com/news/11109/introduction-to-position-based-fluids/
======
simonsquiff
If you have an iPad I highly recommend getting LiquidSketch. It's a great
puzzler about getting pools of liquid into the right place, and the liquid
effect is stunning. It moves exactly as expected, has surface tension, splits
and recombines etc - but the really stunning element is colour mixing. When
two groups of different colours combine the mixing of them is just utter
convincing, and beautiful. Amazing how this was all done on a lowly iPad.

~~~
vilya
When you say "on a lowly iPad", bear in mind that the latest (4th-gen) iPad
has a dual core 1.4 GHz chip plus a GPU capable of 14.4 GFLOPs. It's actually
a pretty powerful machine.

~~~
miahi
You still cannot compare it with the GPU from the OP rendering, that does 3000
GFLOPS (GTX 680).

~~~
jerf
I can however compare it to the famous Cray 2 supercomputer, capable of
1.9GFLOPS.

Remember when we were promised we'd someday have supercomputers in our
pockets? We do.

Well, ok, fairly big pockets in the case of the iPad, but still, you get my
point.

~~~
vanderZwan
We also were promised real-time raytracing if we ever got to that point.
What's the hold-up?

~~~
Retric
Real time raytracing is vary doable and high quality, it's just we got really
good at rasterisation. Consider a 2012 demo
<http://www.youtube.com/watch?v=h5mRRElXy-w> it's cool and all but what
seperates it from rasterisation is fairly subtle and the computing costs are
rather high.

~~~
rangibaby
Thanks for sharing this. I'm actually really excited; raytraced scenes have a
"solid" feel to them that rasterized ones simply can't get.

------
Keyframe
Impressive for real-time, but nowhere near realism one can get with Naiad or
Realflow and a proper renderer. For example: <https://vimeo.com/37536300>

------
Vivtek
The only uncanny valley effect here is that the water doesn't wet anything -
everything is perfect Teflon. So it's hard to judge whether the movement of
the water is perfectly realistic, because I keep looking at the transitions.
If I don't look at surfaces, it seems very convincing.

~~~
mtgx
The color is also not right. But the animation seems almost flawless
otherwise.

~~~
pionar
Really? The color's not right? Not all liquids are the same color. Hell, not
all water is the same color. But the GP is right when the water doesn't wet
anything, it's kinda eerie.

EDIT: Having said that, water simulation is HARD.

~~~
Cushman
I think the point is that water is only technically blue; in small quantities
like those simulated, its appearance is mostly the effect of refraction and
scattering and all that fun stuff, which is a whole new can of worms. So they
add some blue (or green) partly to make it more obvious what's going on, but
partly to cover up for the optics not being quite right.

You can see it especially in the last demo in the video. When the water
spreads across the floor, it looks a little like a puddle of blue dye is
diffusing into the water, and it's hard to tell how it would look if the water
were more realistically transparent.

------
coherentpony
Jaw-dropping? Maybe. Realistic? Nope.

I work in a group with scientists whose sole job is to solve the Navier-Stokes
equations. Now that's realistic.

~~~
aolol
Perhaps you could elaborate on this. I do agree that the title and video give
slightly more credit than is due based on the current state of fluid dynamics
knowledge. However do you mean your group is searching for closed-form
solutions to NS or are you generating approximate numerical solutions (CFD)?

~~~
coherentpony
Approximate solutions are found computationally.

Non-trivial closed-form solutions are hopeless. Existence of solutions is a
little less hopeless. Existence of solutions over small time horizons has been
proven. This is all in three space dimensions.

There is a theorem stating that if global-time solutions exist and are unique,
then computationally computed approximate solutions are 'good'. Moreover, they
get better as you refine the computational domain.

~~~
noname123
Is finite element method good enough? Can you provide a concrete example where
approximation is not good enough.

~~~
coherentpony
Special approximations called 'Galerkin approximations' converge.

Finite element methods are a special case of Galerkin methods. Finite element
methods are good enough.

------
timdorr
I think the nVidia real-time ray tracing demo is more impressive:
[http://www.youtube.com/watch?v=w9SH8xlgzoI&feature=playe...](http://www.youtube.com/watch?v=w9SH8xlgzoI&feature=player_embedded)

Primarily because of the distortion of the visuals through the water. This
simulation fakes it somewhat, which you can see with the distortion being
somewhat blocky.

------
aethertap
This should lead to much more interesting interactions with water in games,
because now it has actual physical properties instead of just being something
pretty to look at. Watching the water flow out of the aquarium makes me think
that water is about to become a real active part of the game environment. Very
cool.

~~~
FuzzyDunlop
I remember Super Mario Sunshine was much lauded in the games press because of
what it did with water and the effects. I absolutely loved the game but you
don't really hear much about it any more.

------
th0ma5
When I look at this water, it feels as though the volume of water is the size
of like an acre. Is this to exaggerate the effect or is this a limitation of
our current modeling capability?

~~~
carlob
Yeah, what you're referring to is the fact that surface tension is not scale
invariant. In other words: dew can only be made of smallish droplets, not
large ones.

I think the reason you see that is that they don't really simulate surface
tension, but use a rather crude trick [0]. My uneducated guess is that in oder
to achieve water that looks ok at small scales they would have to increase the
size of the particles to the point it doesn't look smooth anymore.

[0] equation (14) of <http://mmacklin.com/pbf_sig_preprint.pdf>

~~~
wfunction
> Yeah, what you're referring to is the fact that surface tension is not scale
> invariant. In other words: dew can only be made of smallish droplets, not
> large ones.

You completely blew my mind there! I'd never noticed that before.

Does the size of a dew drop relate to the size of the particles? i.e. can we
estimate the size of water molecules just by looking at the maximum dew drop
size?

~~~
carlob
Wait wait wait. I was talking about the particles in this particular
simulation.

Surface tension is _not_ a function of the size of water molecules. In fact
you can change it quite easily just by adding a little soap.

~~~
wfunction
D'oh, I was being stupid, thanks.

------
_crumbs
The clip showing the water interacting with breaking glass blew my mind. It
may well be a while before we see anything close to that level of realism
being incorporated into games though.

~~~
Cthulhu_
True, but technologies like this usually make their way into pre-rendering
first, i.e. pre-rendered cutscenes in games, CGI scenes in movies, or fullly
animated movies. Although the latter category hasn't seen much in the way of
realism, mostly due to uncanny valleyness.

~~~
MrScruff
This isn't prerendered - it's real time. Prerendered water (as seen in movies)
looks far more realistic than this. Check out the Naiad link someone posted
above.

This is great for real time though. It's using a form of SPH which is far
easier to adapt for GPUs, and can crunch through those particle-particle
interactions.

High end offline water sims would use a different algorithm (usually FLIP),
maybe run for several days to sim a few seconds and occupy 10's of Gb of
memory.

If anyone's interested, download a copy of Houdini Apprentice for free and
have a play.

------
nobodysfool
I've never seen water simulations that can pass the U test. Basically, take a
pipe, bend it into a U shape, pour the water in one side, and see if the water
levels even out. If it does, then it's a very accurate simulation of water.

~~~
andypants
What happens instead in the simulations that fail?

~~~
nobodysfool
usually the water fills up the bottom part of the U until it reaches the width
of the pipe, the only one side fills up (the supply side). So if I fill up the
left side of the U pipe, the water forms an L shape. On some simulations, the
other side rises, but doesn't really even out.

------
pcl
Cool stuff, but the viscosity seemed a bit off (especially noticeable when the
glass walls were shot out towards the end), and waves seemed to hold their
shape for a bit too long. I wonder how hard that'll be to tweak.

------
missing_cipher
I prefer their ocean simulator:
[http://www.youtube.com/watch?feature=player_detailpage&v...](http://www.youtube.com/watch?feature=player_detailpage&v=A84v7lbdcYg#t=565s)

------
incision
Perhaps it is the _most_ realistic, but I've yet to see a fluid demo, this one
included that didn't look like overly "energetic" shampoo.

------
Scriptor
It's definitely realistic, but sometimes it seems just _a little_ off. There
are times when it seems to "clump" up like a solid would when you have water
particles thrown in the air. I'm not sure if that's my own bias or the uncanny
valley effect at play here.

~~~
rmrfrmrf
I noticed that too; seems like it might be a matter of making the particles
smaller.

------
tome
This reminds me of a much older open source game where two players controlled
liquids and the aim was to engulf the other liquid. I can't remember the name
of the game, though.

~~~
cbhl
liquidwar?

~~~
tome
Yes! What a funny game.

------
kvprashant
Somehow, I felt wow. I am able to appreciate this because of the number of
applications it holds - Tsunami simulation, Bridge and dam construction. And
real-time? Full points!

~~~
jjoonathan
Artistic water simulation and scientific/engineering fluid simulation tend to
be mutually exclusive in that they optimize for different objectives.
Typically, a solution in one domain is ill-suited for the other. For instance,
the "Stable Fluids" trick leads to desirable artistic properties (fluid
behavior more closely matches stage direction = active energy input) at the
expense of systematic inaccuracy (total energy is biased downward) that would
be undesirable in an engineering context.

If this technique worked equally well in both domains it would go from
"impressive" to "miracle". In the meantime, we can certainly applaud it for
the things it does do well!

------
Y0L0
Particle generators like this have been used in Hollywood for quite awhile, I
bet you would have never have guessed it was CGI though.

~~~
atdrummond
The difference being that this demonstration is real-time.

~~~
Y0L0
Thank you for clearing that up, now this is actually impressive, although I
would imagine it would require a ton of GPU & CPU power.

~~~
kevingadd
PhysX is aimed at running on current generation 'consumer grade' gaming
hardware, so think a GPU you can get for $200 (if not less). It works out of
the box on all of NVIDIA's modern graphics cards.

Of course, you do have the problem of what to do when the water sim uses up
all the available GPU compute power and bandwidth - not much left to render,
in that case...

------
rip747
honestly, after watching the demonstration video, there is nothing in the
video that i haven't seen in numerous hollywood films or games before. am i
missing something? would someone care to explain what i should be looking for?

~~~
gknoy
I've never seen water simulation with this degree of complexity in games. I've
seen it in prerendered video sequences, but when you sit and look at a lake or
river in an Elder Scrolls game (or similar), it is usually much more
simplified -- or has a flow which is modeled to look pretty.

The difference here is that it's showing interaction between the water
particles and things that they impact on: characters, boundaries, piers, and
behave in a more realistic way than games have previously had.

------
alexvr
Yeah, that does it. We live in a computer simulation.

------
SiVal
Does anyone here know what technology stack this is implemented in/with/on?

~~~
angersock
C/C++/nVidia (formerly Ageia, formerly Novodex) PhysX.

------
spoiledOldGuy
That is so god-like! I give up I do not want to program anymore.

~~~
xiaoronglv
very cool

