Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Pages: [1]
  Print  
Author Topic: Storm at sea III (TV3D v. 6.5)  (Read 8905 times)
Waterman
Moderator
Community Member
*****
Posts: 1159


« on: April 28, 2005, 04:41:18 PM »

More troubled water. No storm, but a nice and fresh 7 beaufort breeze.

Screenshots (about 200 kB each):

Movies (around 3 MB each):



The water surface is made using a vertex & pixel shader. It's working on a 50 by 50 grid with 3 TVUnits (meters) density. The water surface tiles perfectly (and THAT was a challenge), so it's actually rendered 9 times at different locations. The white spray is maintaned in another (pixel) shader which uses the same set of algorithms for height calculation as the main shader (i.e. puts spray mostly on wave tops). It lets two instances of one spray texture (pic of below, took 1 minute to paint it in PSP8) "roll" over each other, thus achieving ongoing variation in the output calculated from both. The fade effect is made by "bouncing" the accumulated texture (the water surface from previous frame plus new spray inserted to the current frame by a set of rules) between two render surfaces. It fades out from 255 to 0 in exactly 10 seconds. The resulting spray texture is then constantly applied onto the water surface reflection & refraction result. The app code maintains around 160 force vectors each for the ships, i.e. the code is able to resolve the water surface height at any point (16 per ship) exactly as the vertex shader does. The vectors are consolidated into one single force and one torque as a result of a fairly complex calculation, both are then passed on to the Newton physics for dynamics & object repositioning.
Logged

Things should be described as simply as possible - but not simpler [A. Einstein]
Frost
Community Member
*
Posts: 153


« Reply #1 on: April 28, 2005, 05:10:37 PM »

:shock:  once again im shocked  :lol:
Logged

darqSHADOW
Administrator
Community Member
*****
Posts: 2817


« Reply #2 on: April 28, 2005, 05:23:38 PM »

That is simply amazing, and it gets better every time I see it.  Great work Waterman, keep it up!  (Now to just have it generate a particle system when the "bob" of the ships changes drastically...)  Wink

DS
Logged

TrueVision3D Project Manager
The fast and simple way of 3D development.
GoodVillain
Community Member
*
Posts: 1631


« Reply #3 on: April 28, 2005, 06:20:36 PM »

Nice water effects. Better then last time. Smiley
Logged
Eric
Customers
Community Member
*****
Posts: 808


« Reply #4 on: April 28, 2005, 06:22:08 PM »

lookin' very nice  Cool
Logged
Vuli
Customers
Community Member
*****
Posts: 407


« Reply #5 on: April 28, 2005, 06:53:41 PM »

... speechless...

You're not WATERman for nothing Wink

V
Logged
BlindSide
Customers
Community Member
*****
Posts: 760


« Reply #6 on: April 29, 2005, 12:58:59 AM »

Incredible stuff man, keep it up!
Logged
SylvainTV
Administrator
Community Member
*****
Posts: 4971


WWW
« Reply #7 on: April 29, 2005, 05:51:06 AM »

Definitively nice :p Continue ! Smiley
Logged

Regards

Sylvain Dupont
TrueVision3D Developer
sylvain@truevision3d.com

TV3D IRC at http://chat.truevision3d.com or on server irc.truevision3d.com #Truevision3D. Come talk with us !
brimstone
Community Member
*
Posts: 300


WWW
« Reply #8 on: April 29, 2005, 09:00:18 AM »

Love the ships too.
Logged

Project: ^
Status: ^^.^% complete
dxman.net
nacra
Community Member
*
Posts: 47


« Reply #9 on: April 29, 2005, 10:25:39 AM »

Good stuff Waterman.  I love how the frigate reacts to the waves, just a subtle amount of pitch and roll that seems right for that size ship.  Shading on the wave crests is nice too.

And have you posted any hints on how you're getting the vertex positions of the water back from the gfx card?  Maybe this is secret Finish knowledge.  ;-)  I remember some mention of a tv3d change made so this would work for you but couldn't find any samples in the forums.
Logged
AriusMyst
Guest
« Reply #10 on: April 29, 2005, 12:43:13 PM »

Not much I can say, except again, top notch stuff man  Smiley
Logged
Waterman
Moderator
Community Member
*****
Posts: 1159


« Reply #11 on: April 29, 2005, 04:05:57 PM »

Thanks for the positive feedback Arius & everyone else.

The heigh at any point on the water surface is a sum of

+ f(pos, time, k1)
+ f(pos, time, k2)
+ f(pos, time, k3)
---------------------
Height at position "pos"

The function f uses basically sin() and the constants kx are each a configuration set for each of the 3 waves that are composed into a total wave, i.e. into a height at any point ("pos") on the water surface = what is seen on screen.

There is unfortunately no way to get the height data out from the shader, so both the shader code and the appliation code contain identical (but separate) algorithms to get the height.

The shader runs that code thousands of times per frame, while the application runs it's own corresponding code only when needed, and only for the positions of interest (i.e. the ship's position).
Logged

Things should be described as simply as possible - but not simpler [A. Einstein]
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks