UFO:Alien Invasion

Development => Mapping => Topic started by: Sandro on August 31, 2012, 07:39:23 pm

Title: Procedural water - why not?
Post by: Sandro on August 31, 2012, 07:39:23 pm
Personally, I don't like current water at all. Current "water" swirling material could be good for Quake's murky basins,  is not good for simulating the kind of water we usually meet; even more, it behaves differently in FFP and GLSL renderers, which somewhat breaks the "mansion" map (and maybe some others).
I've been thinking about it a lot, considering various ways, but was always returning to the same thought: we can use the same approach as in Cossacks, using the procedural water simulation to create random, realistically-looking water. And they were doing on 100 MHz Pentium, remember? It was fast enough.
Finally, today it somehow dawned on me, so I've understood how to make simplest possible fluid solver, so after a few hours it was written, tested and tweaked to look like real water (it is not physically correct, but is based on real world hydrodinamics).
It is relatively fast: unoptimized version, being written entirely in Java consumes only about 1% of CPU while rendering 256x256 heightmap at 20 frames/sec.

I'm attaching it to the post, so everyone could play with it and say whether it is good or not. Requres Java Standard Edition (SE) 1.6 or later. Download, extract fluidsolver01.jar from the archive and run with "java -jar fluidsolver01.jar"
Click or click-drag mouse to disturb water, there are no built-in wave generators for now.
Title: Re: Procedural water - why not?
Post by: Mattn on August 31, 2012, 08:54:20 pm
it looks cool - can't wait to see this in ufoai itself ;)
Title: Re: Procedural water - why not?
Post by: Crystan on September 01, 2012, 11:12:28 am
Awesome! Awesome! Awesome!
Title: Re: Procedural water - why not?
Post by: fhstoica on February 19, 2013, 12:22:33 pm
Hi,

The attachment is a (zipped) animation of the surface waves that can be generated with the code (surface_waves.tar.gz) I posed at:
http://ufoai.org/forum/index.php/topic,7472.15.html

Let me know if this is what you are looking for.