Water rendering - Page 4

Water rendering

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Post Reply
User avatar
FireCrack
Posts: 676
Joined: 19 Jul 2005, 09:33

Post by FireCrack »

SinbadEV wrote:I think the battle is supposed to be much slower then the acctual gameplay suggests... battles taking days instead of hours... so the speed of the water... ah whhatever... I'm just making excuses...
It's actualy supposed to be ~4 times faster.
User avatar
Zenka
Posts: 1235
Joined: 05 Oct 2005, 15:29

Post by Zenka »

The waves are incredibly awesome.
Wind causing waves would be great!
But more waves means more calculating for your GPU, haw many waves can be preformed until your 6800 starts to run short?
(My poor X800Pro)
Doomweaver
Posts: 704
Joined: 30 Oct 2004, 14:14

Post by Doomweaver »

Do more waves actually increase the GPU load? Somehow I doubt it.
User avatar
Maelstrom
Posts: 1950
Joined: 23 Jul 2005, 14:52

Post by Maelstrom »

Whats the chance of getting sharp peaks on the waves? Sharpish waves would probably look a bit better I think. Really nice work so far.
IMSabbel
Posts: 747
Joined: 30 Jul 2005, 13:29

Post by IMSabbel »

Doomweaver wrote:Do more waves actually increase the GPU load? Somehow I doubt it.
If it works like any of the other navier-stokes solvers on gpu basis (there are tons of them around), then the speed should more or less be depending on the resolution of the mesh used.
More waves would just mean that there are more "non-zero" matrix elements.
(of course it _would_ be possible that caching related stuff will cause worse performance with denser datasets, also a clever algorithm may cut corners by simply not solving unpopulated parts of the mesh...
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

IOW, it's basically going to eat a lot more GPU for the resolution, per render. That'd be all right, if it wasn't doing so many other things besides a mesh transform on the fly. I can see why it's eating a lot've frames, though.
Doomweaver
Posts: 704
Joined: 30 Oct 2004, 14:14

Post by Doomweaver »

Hang on - is it actually deforming a mesh, or just changing the angle that the reflections are rendered from, causing it to appear deformed?
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

Based on what I saw in the videos, it's obviously deforming a mesh on the fly. Which is going to get downright nasty when you have huge naval battles, but hey, it'll be the coolest slideshow around ;)
User avatar
krogothe
AI Developer
Posts: 1050
Joined: 14 Nov 2005, 17:07

Re: Water rendering

Post by krogothe »

SJ wrote: unfortunally it seems like it will become quite a bit slower then I had hoped so it will only work on high end nvidia cards.
Im sure i had a demo for my GeForce2 Ti that had this exact same effect and it ran it fine! There should be lots of room for optimization if it wont run on a low-end card!
SJ
Posts: 618
Joined: 13 Aug 2004, 17:13

Post by SJ »

It changes the mesh in the vertex shader based on a texture so im not sure if that counts as deforming the mesh. So performance will in no way depend on how many ships are present (except that it will have to render in the ships positions into the texture but thats a quite minor cost)
Whats the chance of getting sharp peaks on the waves? Sharpish waves would probably look a bit better I think. Really nice work so far.
Sharp peaks are unfortunally quite hard to get with this sort of approximate solver (its so far removed from NS that i wouldnt call it an approximate NS solver)
Im sure i had a demo for my GeForce2 Ti that had this exact same effect and it ran it fine! There should be lots of room for optimization if it wont run on a low-end card!
Yeah sure you go ahead and optimize it for your GF2.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

Hmm, neat. I assumed that you were doing some sort've method of building a mesh on-the-fly, because of the way that it looks- it's quite a bit more complex-looking with multiple objects, so it's good to know it won't be eating up GPU exponentially :-) I like that new shader that fellow wrote, too... maybe after he's gotten a bit farther, we can get him to finally do transparency for the blue channel, so that I can build some really awesome stuff :-)
User avatar
Nemo
Spring 1944 Developer
Posts: 1376
Joined: 30 Jan 2005, 19:44

Post by Nemo »

That video you had of the skeeters has been the first spring engine media to make me gasp since agorm's tree battle screenshot.

Brilliant work SJ, looks like I have one more reason to upgrade.
Tweenk
Posts: 14
Joined: 19 Mar 2006, 23:41

Post by Tweenk »

Few tips to greatly improve realism:
1. Currently only the ships are deforming the water, and without them skimming across it's dead flat. That looks as if the whole world is enclosed in a windless chamber. Add some non-stop "deformators" to simulate wind blowing over the water
2. Some "animated waves" texture blended with the reflections would cause the water to look more to-scale (the NS solver would emulate the large waves and the texture - the smaller ones)
3. Not sure if this is already implemented this way, but the transparency of the water should vary depending on the angle from which you are viewing (i. e. the water should be almost 100% reflective / textured when looking sideways and, say, 30% reflective / textured and 70% transparent (heh I hope you get the point)

I'm no programmer at all so I don't know how difficult those things are to code. :wink:
User avatar
SinbadEV
Posts: 6475
Joined: 02 May 2005, 03:56

Post by SinbadEV »

the current rederer for reflactive water does the "varied transparency" thing quite well from what I'm told
User avatar
FireCrack
Posts: 676
Joined: 19 Jul 2005, 09:33

Post by FireCrack »

^called the frensel effect
hawkki
Posts: 222
Joined: 01 Jan 2006, 19:47

Post by hawkki »

That water is just something extremely cool! I mean WHOA! Great job!
User avatar
IceXuick
Posts: 519
Joined: 14 Mar 2006, 01:46

Post by IceXuick »

^called fresnel :wink:
User avatar
Dragon45
Posts: 2883
Joined: 16 Aug 2004, 04:36

Post by Dragon45 »

NS -> Navier-Stokes, its a general equation for behavior of a fluid's particles (IIRC). I suspected SJ used it or soemthing similar; the "approximation" bit is because it can be ridiculously expensive to calculate more exact solutions.

SJ, any chance of throwing in a randomizer(), with a chance of a mesh section being several units higher than its surroundings correspond to the curve of a rational function, so that most mesh sections will be low, some will be "medium", and a few will be "higher peaks" etc? Statistically it would all even out in the end and probably add a very small amount of computation to the GPU load (relative to the current GPU load anyway...)

Also, im guessing that bigger weapons create bigger waves etc so that a nuke will have a far higher wave than a laser?
SJ
Posts: 618
Joined: 13 Aug 2004, 17:13

Post by SJ »

Dragon: Im not exactly sure what you mean, but as you say waves can have different heights so you cant detect the crest of a wave by its height value alone. Detecting where on a wave a texel is based on comparing to its neighbour could work perhaps but would require quite a big window to compare against to to avoid it getting too noisy, and thus it would be very expensive.

So I dont think its possible to get away from the sinusoid form of the waves that way although if anyone could do it after I release the code it would of course be very cool.
User avatar
Dragon45
Posts: 2883
Joined: 16 Aug 2004, 04:36

Post by Dragon45 »

Well what i was trying to say was that you could use teh power of statistics to randomly "seed" a crest or two in any given wave, or every other wave, etc. and not have it become too noisy; once a crest-seed was planted then you could use texels and the orientation of the "crest" to determine how the texels based on the orientation should color themselves and so not have a very big window to compare agaisnt and thus save a TON of calculations instead of comparing against a big window, BUT I SPEAK TOO MUCH!

Release teh code! :D

More code == more fun.


Pardon the rushedness.


<-------------- UNNATURALLY ENERGIZED
Post Reply

Return to “Engine”