Water Flowmap Shader - Proof of Concept.

Posted By: Steempipe

Water Flowmap Shader - Proof of Concept. - 12/20/15 02:49

Hi all, I've been spending some spare time getting re-acquainted with the engine and working on a shader that I had abandoned several years ago. I think I have it going well as the whole, and can now work on individual components in the shader.

Eventually, when I get the thing ironed out to my satisfaction I'll post the code in the Wiki with a tutorial. It is kind of a neat concept in my opinion. And something I had always wanted to incorporate into the game/level I could never see to make!

http://steempipe.painthorsestudios.net/waterflow/water_flow_101_release01.zip

//***************************************************************************
// water_flow_101_release01 -- 12/19/2015 -- Steempipe (Eric Hendrickson-Lambert)
// animate water flow direction with a flowmap in the pixelshader.
// version 101 uses a static cubemap for relection, and requires much work
//
// requires: 3DGS A8 C/P, vs/ps2_0, DirectX 9
//
// based on the implementation presented here:
// http://graphicsrunner.blogspot.com/2010/08/water-using-flow-maps.html
//
// flowmap produced from tool here:
// http://teckartist.com/?page_id=107
// ***************************************************************************

Press '0' to use free the camera, arrow keys to move
right mouse button to pan/tilt
'esc' to quit


TODO:
-Continue to smooth out the pulsation effect
-Improve the specular component, add the fresnal effect
-Increase perturbation of environment map, fix artifacts, etc
-Change code for realtime reflection/refraction
-Produce a demo level and tutorial on the use



Posted By: 3run

Re: Water Flowmap Shader - Proof of Concept. - 12/20/15 10:04

It looks really nice! I suggest adding a flowing shore map later, near by the terrain and on those perturbation lines (take a look at the screen):


Keep it up! Best regards!
Posted By: Steempipe

Re: Water Flowmap Shader - Proof of Concept. - 12/20/15 12:22

Thanks for the suggestion!
Posted By: HeelX

Re: Water Flowmap Shader - Proof of Concept. - 12/20/15 19:07

Its good news to me seeing you back here at the forums, Steempipe. Keep it up!
Posted By: Steempipe

Re: Water Flowmap Shader - Proof of Concept. - 12/21/15 00:24

Good to see you too, HeelX. I'm impressed with what you have done here!
Posted By: Tele

Re: Water Flowmap Shader - Proof of Concept. - 01/27/16 19:52

Everything is great but where is the water.fx
no .fx no demo. :-(
Posted By: Steempipe

Re: Water Flowmap Shader - Proof of Concept. - 01/28/16 02:45

Tele~ Thanks for the reminder. I've got to get back on it, and get the project/code cleaned up some.
Posted By: Tele

Re: Water Flowmap Shader - Proof of Concept. - 01/30/16 17:42

@Steempipe
Thaks, I hope so ;-)
Posted By: Steempipe

Re: Water Flowmap Shader - Proof of Concept. - 02/04/16 00:49

Making some minor progress on the flowmap shader. There is still alot of minor things to contend with, but it's slowly moving along. It's very difficult to deal with the pulsating effect and will probably be a situation where there will have to be compromise.

Video of Flowmap Shader 2-3-16

Posted By: Steempipe

Re: Water Flowmap Shader - Proof of Concept. - 02/05/16 03:25

Current state:
-"reflections" with cubic environment map bumpmapping.
-Added a Fresnel term to control transparency.
-Added code for specular highlights from sun direction/color

Next goal is foam mapping.

Video of shader

Posted By: jenGs

Re: Water Flowmap Shader - Proof of Concept. - 02/05/16 08:43

Very nice, but somehow I like the first one without the environment map. Looks more like a rough river.
Posted By: Steempipe

Re: Water Flowmap Shader - Proof of Concept. - 02/05/16 09:54

Originally Posted By: jenGs
Very nice, but somehow I like the first one without the environment map. Looks more like a rough river.


I think there will have to remain options for roughness and turbidity. That will be a better place to work out the foam suggestion that 3RUN had anyway.
Thanks.
Posted By: Steempipe

Re: Water Flowmap Shader - Proof of Concept. - 02/06/16 02:31

Added support for dynamic lighting today.

Posted By: Steempipe

Re: Water Flowmap Shader - Proof of Concept. - 02/10/16 20:09

Here's the demo and code for the project as it is now. There are plenty of aspects that need finer tuning. I'll slowly work on that... And I hope that other users can modify and contribute to making it better.
On my TODO list:
1). Dynamic lights.. I removed since they were not behaving.
2). A smoother normalmap/flowmap blend... fi; "pulsations".
3). A development panel with sliders to tweak and save results.
4). Reflections/refraction's in render textures.
5). Fallback techniques

Complete project 2-10-16

Read the "readme.txt" and any comments in the code. I'll give assistance where I can.

Any assistance with this effect will be greatly appreciated. I have had lots of enjoyment with porting this stuff to 3DGS. Hell, the last "water work" I did here was way back in 2004-2005 so it's been a long-assed time.

Have fun and contribute!
Posted By: Steempipe

Re: Water Flowmap Shader - Proof of Concept. - 02/15/16 13:44

Really??? Nobody has stress-tested the effect on different cards for problems, tested it, made improvements???
Feedback is helpful... I only have one type of GPU.
Posted By: 3run

Re: Water Flowmap Shader - Proof of Concept. - 02/15/16 14:11

Steempipe@ I tested it on my Radeon HD 6670 and it works pretty nice! I could only think of creating shore maps to make it look more realistic, as I already said before.

Greets!
Posted By: Steempipe

Re: Water Flowmap Shader - Proof of Concept. - 02/16/16 23:47

Glad it works ok on a Radeon... Mines Nvidia.

I am making some progress on the shore/foam map.

Thanks!
Posted By: sebbi91

Re: Water Flowmap Shader - Proof of Concept. - 02/18/16 11:15



Hmmm it seems that it doesn`t work perfectly.
I am using a laptop with a Geforce GTX 780M
Posted By: Steempipe

Re: Water Flowmap Shader - Proof of Concept. - 02/20/16 13:42

Originally Posted By: sebbi91


Hmmm it seems that it doesn`t work perfectly.
I am using a laptop with a Geforce GTX 780M


Thanks for reporting.
Can you zero in on the part that is not working right?
© 2024 lite-C Forums