Product Chat / GG Water - Ocean Waves - Experimental Shader

Author
Message
cybernescence
GameGuru Master
11
Years of Service
User Offline
Joined: 28th Jan 2013
Playing: Cogwheel Chronicles
Posted: 4th Sep 2018 15:36
Hi all,

I was wondering if anyone else is working on the GG water?

Cogwheel Chronicles is open world - well open sky over open ocean - so as good as the water effect is now I need something with a bit more swell like the video (Gerstner formula used for the waves):



But as well as the wave effect, I also need to get the world position of the ocean vertex where the player (or entity) is positioned so that I can get boats and such bobbing with the wave motion - anyone know how to do that? Or is there a way with physics?

Cheers.
Teabone
Forum Support
18
Years of Service
User Offline
Joined: 8th Jun 2006
Location: Earth
Posted: 4th Sep 2018 15:59
That is a thing of beauty. Is it a modification of the water plain or is it an entity?
Twitter - Teabone3 | Youtube - Teabone3 | Twitch - Teabone3 | TGC Assets - Store Link | Patreon - Teabone3

i7 -2600 CPU @ 3.40GHz - Windows 7 - 8GB RAM - Nivida GeForce GTX 960
cybernescence
GameGuru Master
11
Years of Service
User Offline
Joined: 28th Jan 2013
Playing: Cogwheel Chronicles
Posted: 4th Sep 2018 16:29
Hey Teabone, thanks - currently it is an entity - as at the moment the engine water shader runs on a flat engine created plane. This shader needs a grid rather than a plane as it needs to deflect the vertices to produce the waves.

I can see a way to get it into the engine as an option though (I think - as long as a grid can be created as well as a plane).

Cheers.
Pirate Myke
Forum Support
14
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 4th Sep 2018 17:32
That looks great.
Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 2400 Mhz, 4 Core(s), 4 Logical Processor(s), 8gb RAM, Nvidia gtx660, Windows 7 Pro 64bit, Screen resolution 1680 x 1050.

Bored of the Rings
GameGuru Master
19
Years of Service
User Offline
Joined: 25th Feb 2005
Location: Middle Earth
Posted: 4th Sep 2018 19:01
looks fantastic, well done with that
Professional Programmer: Languages- SAS (Statistical Analysis Software) , C++, C#, VB, SQL, PL-SQL, JavaScript, HTML, Three.js, Darkbasic Pro (still love this language), Purebasic, others
Hardware: Dell Precision 490; AMD Radeon HD 7570; 12GB.
synchromesh
Forum Support
10
Years of Service
User Offline
Joined: 24th Jan 2014
Location:
Posted: 5th Sep 2018 02:08
cybernescence pushing the envelope yet again ..
Amazing !!
The only person ever to get all his work done by "Friday" was Robinson Crusoe..
PM
Ertlov
GameGuru BOTB Developer
17
Years of Service
User Offline
Joined: 18th Jan 2007
Location: Australia
Posted: 5th Sep 2018 04:18
That's some high quality shadow work here.

What's the impact on performance?

"I am a road map, I will lead and you will follow, I will teach and you will learn, when you leave my sprint planning you will be weapons, focused and full of JIRA tickets, Hot Rod rocket development gods of precision and strength, terrorizing across the repository and hunting for github submits."
Preben
20
Years of Service
User Offline
Joined: 30th Jun 2004
Location:
Posted: 5th Sep 2018 08:56
cybernescence:

Im afraid this is running in the vertex shader , so you will have no way to get the height , i seen people trying to "emulate" the shader in CPU to get the height all have failed it will never be accurate. Ray cast (physics) will not work it will always use the CPU vertex data. Ray marching in the shader would kill your FPS, so i guess your only option is to change this to run on the CPU ( just changing the vertex data ) , this would allow you to use ray casting to get the height. but it do look great
Subscribe and checkout great GameGuru/AGK video's here: Videos click here
Latest GameGuru Loader news: News click here
Get GameGuru Loader PBR version here: Steam click here
best regards Preben Eriksen,
Teabone
Forum Support
18
Years of Service
User Offline
Joined: 8th Jun 2006
Location: Earth
Posted: 6th Sep 2018 00:04 Edited at: 6th Sep 2018 00:06
Raising the actual water height plain as close as possible to the lowest dip of the mesh would be your best way to get this to function with water functions.

I've not tried this yet, but I believe you can hide the water visual entirely and still have the functions of entering below the water height occur - drowning and etc.

I've also not played around with the material index for water which could be assigned to entities:

5 = Liquid Splashy Wet
17 = Shallow Water
18 = Underwater

Cant recall if that is still set up with GG. It was one of the aspects transferred from FPSC to allow for water slash sounds for if impacted and also water splash graphics for if shot and etc. Can't recall if this actually works in GG still or ever. Will have to test at some point.
Twitter - Teabone3 | Youtube - Teabone3 | Twitch - Teabone3 | TGC Assets - Store Link | Patreon - Teabone3

i7 -2600 CPU @ 3.40GHz - Windows 7 - 8GB RAM - Nivida GeForce GTX 960
Stab in the Dark software
GameGuru TGC Backer
21
Years of Service
User Offline
Joined: 12th Dec 2002
Location: Upstate New York USA
Posted: 8th Sep 2018 18:42
Quote: "But as well as the wave effect, I also need to get the world position of the ocean vertex where the player (or entity) is positioned so that I can get boats and such bobbing with the wave motion - anyone know how to do that? Or is there a way with physics? "


This can be done with the Bullet physics engine, but GG is not using the physics engine properly
to be able to add this. In my opnion it would require a lot of work to fix GG in this regard.


The coffee is lovely dark and deep,and I have code to write before I sleep.
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 29th Sep 2018 00:04
Back at the turn of the century, a friend and I made a game called Water Race in Dark Basic. It had a nice water effect (for the time) made with a matrix which deformed to achieve this sort of effect. It's a pity we do not have this sort of thing now as was fast and had all the height data needed for boat positioning I have never found terrains to be anything like as useful or fast since. I remember finding it out a few years after doing it and even then on a 1 gig cpu (the fastest around!) the game ran at unplayable speeds with a mere 700mhz extra cpu power and a mildly faster video card.

Weird how things seem to have got so complicated since then that a similar effect (although far more detailed) is such a massive drain on resources of far faster machines.
SPECS: Ryzen 1700 CPU. Nvidia 970GTX. 16 Gig Memory. Win 10.

Login to post a reply

Server time is: 2024-11-17 18:54:32
Your offset time is: 2024-11-17 18:54:32