real-time physics solver

Discuss, argue, whine, talk but not about Elma.

Moderator: Moporators

Post Reply
User avatar
milagros
Cheatless
Posts: 4560
Joined: 19 May 2002, 17:05

real-time physics solver

Post by milagros »

i've been lately developing a new way to simulate physics (currently mainly fluids and sand, some other stuff under progress) using machine learning for real-time scenarios (games, ..)

here are some videos:
http://youtu.be/4ibq68ZspRI

various materials (I guess water looks the worst):
http://youtu.be/Ye9MhVwNxrc

comments?
[carebox]
User avatar
pawq
38mins club
Posts: 6547
Joined: 24 Aug 2008, 19:56
Team: TR
Location: Southampton, UK

Re: real-time physics solver

Post by pawq »

I have no idea about machine learning, but that looks pretty decent! I agree water looks the worst. I think this is mainly because splashes look unrealistic - they resemble a fluidic mist, rather than a bunch of droplets, which is what water splashes normally look like (or is it the lack of reflections?).

But some of the denser and more viscous fluids already look much more realistic, with droplets or patches forming and interacting (milk!). Sand also looks very decent, I wish games had this simulated at least to some extent!

Self-developed project or part of something bigger?
User avatar
milagros
Cheatless
Posts: 4560
Joined: 19 May 2002, 17:05

Re: real-time physics solver

Post by milagros »

milk & water are exactly the same (both simulation and surface generation algorithm), except that water is semi-transparent and milk lacks foam
[carebox]
User avatar
pawq
38mins club
Posts: 6547
Joined: 24 Aug 2008, 19:56
Team: TR
Location: Southampton, UK

Re: real-time physics solver

Post by pawq »

Maybe it's that foam that makes it look unrealistic then? I think I can see why foamy splash may be valid sometimes, but seems like that's the case all the time in the pool video - the foam dominates droplets a lot. How does it look without teh foam?
User avatar
milagros
Cheatless
Posts: 4560
Joined: 19 May 2002, 17:05

Re: real-time physics solver

Post by milagros »

it is a rendering issue, that means it doesn't matter - every system already has some rendering implemented, and typically much better than the one used here
[carebox]
User avatar
insane guy
Kuski
Posts: 1673
Joined: 22 May 2002, 20:53
Contact:

Re: real-time physics solver

Post by insane guy »

awesome stuff mila!
water and one or two other fluids kinda look like are in a much smaller scale than the objects. Like you're watching the ocean from high up. This gives nice surreal touch (especially to first video) but prolly nat intended...
Anyway, can't wait to play games with real time physics like this!
"Every night, me go to sleep, me have wet dream..."
User avatar
John
first 35tt
Posts: 4738
Joined: 28 Sep 2002, 19:42
Team: WNO
Location: Luleå, Sweden

Re: real-time physics solver

Post by John »

Impressive :o
Image
User avatar
milagros
Cheatless
Posts: 4560
Joined: 19 May 2002, 17:05

Re: real-time physics solver

Post by milagros »

insane guy wrote:water and one or two other fluids kinda look like are in a much smaller scale than the objects. Like you're watching the ocean from high up.
the pool should be approx 6m diameter, so it so kinda big
[carebox]
Cold
Kuski
Posts: 25
Joined: 10 Apr 2015, 16:27

Re: real-time physics solver

Post by Cold »

If you don't import those physics in elma, I'll be disappointed.
Canada
User avatar
Zweq
34mins club
Posts: 4055
Joined: 28 Nov 2002, 15:54
Location: suo mesta

Re: real-time physics solver

Post by Zweq »

so the innovation here is real time? or has it been done before?
Image
User avatar
gimp
Kuski
Posts: 1140
Joined: 28 May 2007, 08:47

Re: real-time physics solver

Post by gimp »

It's cool and it is beyond the scope of anything I know how to do myself. But I can't help but wonder, how will you make money from this? Some part of me thinks you are the type of person who shares things because you have a future business plan in mind. I could be wrong of course, I only know you through occasional internet comments.
God Bless America
User avatar
Sunshine
Kuski
Posts: 413
Joined: 21 Feb 2016, 17:59

Re: real-time physics solver

Post by Sunshine »

they will probably sell/license this tech for use in games. ive seen similar stuff, for example this: https://www.youtube.com/watch?v=Jl54WZtm0QE was made in 2011, what is different with your thing? 6 years in this sort of tech is a long time and it doesnt look that different visual acuity-wise. much less processing power needed or is it just that using machine learning for this is a novel approach or what?
User avatar
milagros
Cheatless
Posts: 4560
Joined: 19 May 2002, 17:05

Re: real-time physics solver

Post by milagros »

Zweq wrote:so the innovation here is real time? or has it been done before?
yes, the only comparable real-time library is NVIDIA flex, and that one is 10-100x slower depending on the size of simulation (their dependency is not linear)
[carebox]
User avatar
milagros
Cheatless
Posts: 4560
Joined: 19 May 2002, 17:05

Re: real-time physics solver

Post by milagros »

Vermin Supreme wrote:they will probably sell/license this tech for use in games. ive seen similar stuff, for example this: https://www.youtube.com/watch?v=Jl54WZtm0QE was made in 2011, what is different with your thing?
that's restricted to heightmap + particles generated for a short time on the surface, online in this method ( https://www.youtube.com/watch?v=1o0Nuq71gI4 ), which has already been used in some games
[carebox]
User avatar
nick-o-matic
Kuski
Posts: 870
Joined: 27 Jan 2007, 12:53
Location: Lappeenranta

Re: real-time physics solver

Post by nick-o-matic »

What is the machine learning part? Is it for finding a new state satisfying the Navier-Stokes equations (or probably some simpler equations since full scientific accuracy is not needed for games etc) after the timestep?

Linearity sounds impressive :)
User avatar
umiz
Kuski
Posts: 381
Joined: 22 Oct 2005, 09:32

Re: real-time physics solver

Post by umiz »

Be careful milagros. milagrosnet. Skynet. Terminator who rides on a bike.
[i cruise, i lev, i live]
User avatar
milagros
Cheatless
Posts: 4560
Joined: 19 May 2002, 17:05

Re: real-time physics solver

Post by milagros »

nick-o-matic wrote:What is the machine learning part? Is it for finding a new state satisfying the Navier-Stokes equations after the timestep?
yes
[carebox]
User avatar
nick-o-matic
Kuski
Posts: 870
Joined: 27 Jan 2007, 12:53
Location: Lappeenranta

Re: real-time physics solver

Post by nick-o-matic »

milagros wrote:
nick-o-matic wrote:What is the machine learning part? Is it for finding a new state satisfying the Navier-Stokes equations after the timestep?
yes
Awesome. Is your machine learning method applicable to solving any set of tightly coupled non-linear differential equations? And is this method something you have been working on in university and then began to apply it to fluid simulations?
User avatar
milagros
Cheatless
Posts: 4560
Joined: 19 May 2002, 17:05

Re: real-time physics solver

Post by milagros »

nick-o-matic wrote:Is your machine learning method applicable to solving any set of tightly coupled non-linear differential equations? And is this method something you have been working on in university and then began to apply it to fluid simulations?
yes (I wouldn't say any, but at least for a large class of problems) and yes
[carebox]
User avatar
niN
Kuski
Posts: 2631
Joined: 22 Aug 2005, 12:23
Team: HoHo
Location: Sweden, Gothemburg
Contact:

Re: real-time physics solver

Post by niN »

Looks cool, I don't know a lot about physics, but I do know a lot about moving water. How did you think/work with the surface tension of the water in this? Is it calculated in at all? For instance, if you drop a ball in the water with speed, it would hit and land hard. Or if the water splashes then the drops forming would be separated from each other and quickly "close up", rather than sticking together... if that makes any sense.
Team HotHorses, and I'm converting to Icelandian now...
User avatar
milagros
Cheatless
Posts: 4560
Joined: 19 May 2002, 17:05

Re: real-time physics solver

Post by milagros »

niN wrote:Looks cool, I don't know a lot about physics, but I do know a lot about moving water. How did you think/work with the surface tension of the water in this?
not sure what kind of answer do you expect if you say you don't understand physics
it is used only for the "mercury" (parameters are fake) - at the scale used there surface tension is irrelevant and typically ignored (for example in all movies)
[carebox]
ofta
Kuski
Posts: 88
Joined: 5 Dec 2013, 19:46

Re: real-time physics solver

Post by ofta »

looks super cool. would love to see it being used in some dark experimental sandbox game.
User avatar
milagros
Cheatless
Posts: 4560
Joined: 19 May 2002, 17:05

Re: real-time physics solver

Post by milagros »

[carebox]
User avatar
8-ball
39mins club
Posts: 4496
Joined: 9 May 2003, 13:30
Team: MiE
Location: Riga, Latvia

Re: real-time physics solver

Post by 8-ball »

Nice ducky action.
39:37,91
User avatar
Grace
38mins club
Posts: 4843
Joined: 19 Nov 2005, 10:45
Location: Deep in your Imagination, Twirling your Dreams and Weaving your thoughts.

Re: real-time physics solver

Post by Grace »

I know you say surface tension is insignificant and therefore ignored, but realistically the cause of surface tension (hydrogen bonding between water molecules) is not insignificant on any scale and ignoring it is probably a significant part of the reason for the difference between real water physics and your water simulation. That said, it's significantly more difficult to emulate something such as hydrogen bonding in such a program, and I think you've done an absolutely phenomenal job simulating this stuff with your own program.
Image Cyberscore! Image
___________________________________________________
Image
Targets: 6 Legendary, 23 WC, 20 Pro, 5 Good | AvgTT: 39:59:96
User avatar
milagros
Cheatless
Posts: 4560
Joined: 19 May 2002, 17:05

Re: real-time physics solver

Post by milagros »

Haruhi wrote:I know you say surface tension is insignificant and therefore ignored, but realistically the cause of surface tension (hydrogen bonding between water molecules) is not insignificant on any scale
the significance of each term of navier-stokes equations in any scale is quantifiable, so if it's only a fraction of a percent, it is insignificant
also when you simulate galaxies, you don't need anything except gravity, even though stars would not hold together without strong nuclear force or electromagneticm
in any case, as I already mentioned the framework allows for surface tension and it is used for other materials, where it is significant (such as mercury)
[carebox]
User avatar
Zweq
34mins club
Posts: 4055
Joined: 28 Nov 2002, 15:54
Location: suo mesta

Re: real-time physics solver

Post by Zweq »

Is it deterministic? Let's say you want to make a physics puzzle game with premade objects that should work the same way everytime. For example object A: water container, object B: sandcastle, object C: tube that transfers water from A to B
Image
User avatar
gimp
Kuski
Posts: 1140
Joined: 28 May 2007, 08:47

Re: real-time physics solver

Post by gimp »

Milagros you are a figure head of the elma scene and probably a scholar, we are very interested in your project. I was wondering, how will this make money?
God Bless America
User avatar
milagros
Cheatless
Posts: 4560
Joined: 19 May 2002, 17:05

Re: real-time physics solver

Post by milagros »

Zweq wrote:Is it deterministic? Let's say you want to make a physics puzzle game with premade objects that should work the same way everytime. For example object A: water container, object B: sandcastle, object C: tube that transfers water from A to B
well.. the algorithm is deterministic, CPU implementation gives always the same simulation
however on GPU, there are some parallel summations done with atomic increments and the sum has a floating-point error depending on the order it was summed
then the epsilon error propagates and after a while it is a different simulation
I guess, it could be fixed by using fixed digit precision
Last edited by milagros on 5 Apr 2017, 12:46, edited 1 time in total.
[carebox]
User avatar
milagros
Cheatless
Posts: 4560
Joined: 19 May 2002, 17:05

Re: real-time physics solver

Post by milagros »

gimp wrote:how will this make money?
by selling the library/plugins to various game/simulation engines
[carebox]
User avatar
Grace
38mins club
Posts: 4843
Joined: 19 Nov 2005, 10:45
Location: Deep in your Imagination, Twirling your Dreams and Weaving your thoughts.

Re: real-time physics solver

Post by Grace »

milagros wrote:
Haruhi wrote:I know you say surface tension is insignificant and therefore ignored, but realistically the cause of surface tension (hydrogen bonding between water molecules) is not insignificant on any scale
the significance of each term of navier-stokes equations in any scale is quantifiable, so if it's only a fraction of a percent, it is insignificant
also when you simulate galaxies, you don't need anything except gravity, even though stars would not hold together without strong nuclear force or electromagneticm
in any case, as I already mentioned the framework allows for surface tension and it is used for other materials, where it is significant (such as mercury)

Taking the most conservative values I could find for the enthalpy values of hydrogen bonding between OH --- O, the standard enthalpy total of water and the average instantaneous number of hydrogen bonds between molecules in a mass of pure water all at Standard temperature and pressure suggests that the electrostatic value of hydrogen bonding in pure water vapour should be about 12.07% of the total electrostatic attraction, although other research puts the instantaneous number of hydrogen bonds much higher, leading to a potential value as high as 18.38% of total electrostatic attraction.

This, as well, is just in water vapour (gaseous state). I'd anticipate at least somewhat of an increase in this electrostatic attraction in liquid state, hence surface tension. I could be doing my calculations incorrectly - and I'll openly admit to not having studied navier-stokes equations or fluid dynamics in any great detail as a biologist and chemist rather than physicist, but I think 12% probably counts as significant for water.

Aside from the fact that there is an entire biological family of arthropods (Gerridae, or Pond Skaters) with the defining characteristic being their use of water surface tension, you can also easily observe it even in a glass of water - which wouldn't be possible if it was only a fraction of a percent's worth of significance towards water dynamics.
Image Cyberscore! Image
___________________________________________________
Image
Targets: 6 Legendary, 23 WC, 20 Pro, 5 Good | AvgTT: 39:59:96
User avatar
milagros
Cheatless
Posts: 4560
Joined: 19 May 2002, 17:05

Re: real-time physics solver

Post by milagros »

surface tension clearly scales with surface (n^2) and other forces with volume (n^3), thus as the simulation size increases, the relative importance of surface tension goes to 0
the representative scale, at which surface tension starts to lose its importance (a few times more and its unimportant), is related to the size of water drops
[carebox]
User avatar
milagros
Cheatless
Posts: 4560
Joined: 19 May 2002, 17:05

Re: real-time physics solver

Post by milagros »

[carebox]
User avatar
Sunshine
Kuski
Posts: 413
Joined: 21 Feb 2016, 17:59

Re: real-time physics solver

Post by Sunshine »

its nice
User avatar
milagros
Cheatless
Posts: 4560
Joined: 19 May 2002, 17:05

Re: real-time physics solver

Post by milagros »

https://vimeo.com/282230568
if you have at least GTX1070, you can download the demo
[carebox]
Post Reply