real-time physics solver

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

Moderator: Moporators

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

real-time physics solver

Post by milagros » 25 Mar 2017, 18:49

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
39mins club
Posts: 5918
Joined: 24 Aug 2008, 19:56
Team: TR
Location: Southampton, UK

Re: real-time physics solver

Post by pawq » 25 Mar 2017, 20:21

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: 4400
Joined: 19 May 2002, 17:05

Re: real-time physics solver

Post by milagros » 25 Mar 2017, 20:51

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
39mins club
Posts: 5918
Joined: 24 Aug 2008, 19:56
Team: TR
Location: Southampton, UK

Re: real-time physics solver

Post by pawq » 25 Mar 2017, 22:22

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: 4400
Joined: 19 May 2002, 17:05

Re: real-time physics solver

Post by milagros » 26 Mar 2017, 00:30

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: 1597
Joined: 22 May 2002, 20:53
Contact:

Re: real-time physics solver

Post by insane guy » 26 Mar 2017, 03:23

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: 4639
Joined: 28 Sep 2002, 19:42
Team: WNO
Location: Luleå, Sweden

Re: real-time physics solver

Post by John » 26 Mar 2017, 13:28

Impressive :o
Image

User avatar
milagros
Cheatless
Posts: 4400
Joined: 19 May 2002, 17:05

Re: real-time physics solver

Post by milagros » 26 Mar 2017, 18:58

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 » 26 Mar 2017, 22:27

If you don't import those physics in elma, I'll be disappointed.
Canada

User avatar
Zweq
35mins club
Posts: 3889
Joined: 28 Nov 2002, 15:54
Location: suo mesta

Re: real-time physics solver

Post by Zweq » 28 Mar 2017, 07:51

so the innovation here is real time? or has it been done before?
Image

User avatar
gimp
Kuski
Posts: 967
Joined: 28 May 2007, 08:47

Re: real-time physics solver

Post by gimp » 28 Mar 2017, 09:43

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: 342
Joined: 21 Feb 2016, 17:59

Re: real-time physics solver

Post by Sunshine » 28 Mar 2017, 10:37

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?
Elma Online DL: HERE.

User avatar
milagros
Cheatless
Posts: 4400
Joined: 19 May 2002, 17:05

Re: real-time physics solver

Post by milagros » 28 Mar 2017, 13:17

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: 4400
Joined: 19 May 2002, 17:05

Re: real-time physics solver

Post by milagros » 28 Mar 2017, 13:19

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: 779
Joined: 27 Jan 2007, 12:53
Location: Lappeenranta

Re: real-time physics solver

Post by nick-o-matic » 28 Mar 2017, 15:15

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: 287
Joined: 22 Oct 2005, 09:32

Re: real-time physics solver

Post by umiz » 28 Mar 2017, 15:18

Be careful milagros. milagrosnet. Skynet. Terminator who rides on a bike.
[i cruise, i lev, i live]

User avatar
milagros
Cheatless
Posts: 4400
Joined: 19 May 2002, 17:05

Re: real-time physics solver

Post by milagros » 28 Mar 2017, 16:50

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: 779
Joined: 27 Jan 2007, 12:53
Location: Lappeenranta

Re: real-time physics solver

Post by nick-o-matic » 29 Mar 2017, 09:06

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: 4400
Joined: 19 May 2002, 17:05

Re: real-time physics solver

Post by milagros » 29 Mar 2017, 13:35

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: 2627
Joined: 22 Aug 2005, 12:23
Team: HoHo
Location: Sweden, Gothemburg
Contact:

Re: real-time physics solver

Post by niN » 29 Mar 2017, 20:51

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: 4400
Joined: 19 May 2002, 17:05

Re: real-time physics solver

Post by milagros » 29 Mar 2017, 23:18

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: 70
Joined: 5 Dec 2013, 19:46

Re: real-time physics solver

Post by ofta » 31 Mar 2017, 13:10

looks super cool. would love to see it being used in some dark experimental sandbox game.

User avatar
milagros
Cheatless
Posts: 4400
Joined: 19 May 2002, 17:05

Re: real-time physics solver

Post by milagros » 3 Apr 2017, 22:51

[carebox]

User avatar
8-ball
39mins club
Posts: 4466
Joined: 9 May 2003, 13:30
Team: BAP
Location: Valmiera, Latvia

Re: real-time physics solver

Post by 8-ball » 4 Apr 2017, 07:55

Nice ducky action.
39:37,91

User avatar
Grace
39mins club
Posts: 4641
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 » 4 Apr 2017, 08:49

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: 1 Lege, 8 WC, 39 Pro, 6 Good | 27 Australian Records | AvgTT: 41:22:72

User avatar
milagros
Cheatless
Posts: 4400
Joined: 19 May 2002, 17:05

Re: real-time physics solver

Post by milagros » 4 Apr 2017, 14:59

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
35mins club
Posts: 3889
Joined: 28 Nov 2002, 15:54
Location: suo mesta

Re: real-time physics solver

Post by Zweq » 5 Apr 2017, 07:12

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: 967
Joined: 28 May 2007, 08:47

Re: real-time physics solver

Post by gimp » 5 Apr 2017, 07:43

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: 4400
Joined: 19 May 2002, 17:05

Re: real-time physics solver

Post by milagros » 5 Apr 2017, 12:45

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: 4400
Joined: 19 May 2002, 17:05

Re: real-time physics solver

Post by milagros » 5 Apr 2017, 12:45

gimp wrote:how will this make money?
by selling the library/plugins to various game/simulation engines
[carebox]

User avatar
Grace
39mins club
Posts: 4641
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 » 8 Apr 2017, 18:40

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: 1 Lege, 8 WC, 39 Pro, 6 Good | 27 Australian Records | AvgTT: 41:22:72

User avatar
milagros
Cheatless
Posts: 4400
Joined: 19 May 2002, 17:05

Re: real-time physics solver

Post by milagros » 8 Apr 2017, 21:20

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: 4400
Joined: 19 May 2002, 17:05

Re: real-time physics solver

Post by milagros » 12 May 2017, 21:58

[carebox]

User avatar
Sunshine
Kuski
Posts: 342
Joined: 21 Feb 2016, 17:59

Re: real-time physics solver

Post by Sunshine » 13 May 2017, 17:46

its nice
Elma Online DL: HERE.

User avatar
milagros
Cheatless
Posts: 4400
Joined: 19 May 2002, 17:05

Re: real-time physics solver

Post by milagros » 7 Aug 2018, 17:16

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

Post Reply