Java-Gaming.org Hi !
Featured games (81)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (119)
games submitted by our members
Games in WIP (576)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  OpenGL Low-poly Fluid?  (Read 1459 times)
0 Members and 1 Guest are viewing this topic.
Offline AullenVerch

Senior Newbie




The univertse is vast!!


« Posted 2013-12-13 06:58:50 »

Hello,

I am working on a game where eventually I am going to want some low poly fluids.
I found this video on youtube that shows almost exactly what I am looking for.

Here is the video.
https://www.youtube.com/watch?v=6seHWxo2mXg

I have no idea where to start with creating something similar to this within OpenGL and LWJGL. I have
a feeling that using the jbullet library might help. The only thing I can think of is a soft body in jbullet, but I am not sure if it will give this effect. Do you know any particle of fluid dynamics libraries that could achieve something along these lines? Or any ideas?

Thanks,
Offline AullenVerch

Senior Newbie




The univertse is vast!!


« Reply #1 - Posted 2013-12-13 11:42:34 »

After a great deal of search I have found almost all but nothing....

Until I ran into this project on github.
https://github.com/xael821/Java-OpenGL-Fluid-Simulation

Here is a link to a video showcasing his work.
https://www.youtube.com/watch?feature=player_detailpage&v=iKTesFgqNt0

Granted his fluid simulation doesn't take on the flat shaded look like my example. But it does appear
to be somewhat low-poly in nature. I could not find any libraries that did something like this though, not even libraries in different languages.  Shocked

So the main question that still resides with me (other then that magic api I'm searching for  persecutioncomplex ) is could something like this realistically scale in a game? I suppose a way of getting around this would be to have fluid dynamics only in regions where the water is in contact with an object. Else resort to a more simple approach without the dynamic fluids..
Offline theagentd
« Reply #2 - Posted 2013-12-13 14:41:37 »

Fluid physics is something that is usually extremely expensive to compute. It's basically a particle simulation where the particles interact with each other (uh-oh). Rendering is then done by generating a mesh from these particles. It'll probably work for small bodies of water, but the code needed for it will be quite difficult to code and require shaders for rendering, at least if you want anything close to realistic water behavior. Your best bet is probably to look up papers on fluid dynamics and try to implement one of them.

Myomyomyo.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline pitbuller
« Reply #3 - Posted 2013-12-13 20:44:46 »

Rending fluid using per face normals instead of smoothed normals is trivial part of otherwise quite complex task.
Offline AullenVerch

Senior Newbie




The univertse is vast!!


« Reply #4 - Posted 2013-12-13 23:01:04 »

Rending fluid using per face normals instead of smoothed normals is trivial part of otherwise quite complex task.

That makes a lot of sense, I realize now that if anything calculating all those surface normals for flat shading could make it even more complicated. But wouldn't you say that the resolution (or how many particles are included) would have a huge impact? The difference between realistic looking water and this could potentially be a huge drop in number of particles involved when creating the mesh.


Fluid physics is something that is usually extremely expensive to compute. It's basically a particle simulation where the particles interact with each other (uh-oh). Rendering is then done by generating a mesh from these particles. It'll probably work for small bodies of water, but the code needed for it will be quite difficult to code and require shaders for rendering, at least if you want anything close to realistic water behavior. Your best bet is probably to look up papers on fluid dynamics and try to implement one of them.

Thank you for being honest about fluid physics memory usage. Might make for it not being a realistic element of the game...
Also, your explanation got me on the right track as to what is going on during fluid physics. I'll have to read more into the math behind fluid dynamics.


Also, I found this really in depth 17 part article on fluids in games so hopefully it will help some.
http://software.intel.com/en-us/articles/fluid-simulation-for-video-games-part-1/
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Longarmx (37 views)
2014-10-17 03:59:02

Norakomi (28 views)
2014-10-16 15:22:06

Norakomi (24 views)
2014-10-16 15:20:20

lcass (27 views)
2014-10-15 16:18:58

TehJavaDev (52 views)
2014-10-14 00:39:48

TehJavaDev (54 views)
2014-10-14 00:35:47

TehJavaDev (42 views)
2014-10-14 00:32:37

BurntPizza (63 views)
2014-10-11 23:24:42

BurntPizza (36 views)
2014-10-11 23:10:45

BurntPizza (77 views)
2014-10-11 22:30:10
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!