Posted: 19th May 2007 21:06
Here is a VS1.1/PS1.4 water shader. I hope everyone with only PS1.4 capabilities can put it to good use.

Enjoy!
Posted: 19th May 2007 21:08
I ve been looking this for ages!!! Thank you! I will test it now
Posted: 19th May 2007 21:15
Nice and simple, remembers me of the UT 99 liquids back then
Posted: 19th May 2007 23:36
Nice effect.
Posted: 20th May 2007 0:30
Excellent work!
What parameter should I change in the shader to slow down the effect?
Posted: 20th May 2007 1:21
@ bob915
Lower the bump speed and wave speed numbers to slow down the effect. The wave speed controls the frequency of the waves in time. The bump speed changes how fast the texture scrolls across the surface. The textures can also be changed by changing the resource string name to match your texture. At the moment I am trying to implement some transparency to the water.
Posted: 20th May 2007 1:25
would be nice if it had reflection/refraction
Posted: 20th May 2007 1:47
Can someone post a screen shot?
Posted: 20th May 2007 3:11
What I see in the Fx file is:

float4 waveSpeed = { 0.000200, 0.000150, 0.000400, 0.000400 }; //freqency of the waves (e.g., waves per unit time..)

float4 bumpSpeed = { 0.031000, 0.004000, -0.030000, 0.020000 }; //bump map scroll speed

As I don't know the meaning of these values, could you give an example of other values that would slow down the effect?
Posted: 20th May 2007 4:49
float4 waveSpeed = { 0.000200, 0.000150, 0.000400, 0.000400 }; //freqency of the waves (e.g., waves per unit time..)

float4 bumpSpeed = { 0.031000, 0.004000, -0.030000, 0.020000 }; //bump map scroll speed


The numbers represent two sets of vertex coordinates that are being manipulated at the same time. They are simply x1,y1,x2,y2
Making the numbers smaller exp.(0.000200) change to (0.000020)etc. or (0.000200) change to (0.000100) will slow down the wave effect.
Making them bigger will increase the effect.
Lowering the bumpSpeed numbers will slow down the effect more than the wave Speed numbers.

Attached is a slower .fx file. Load it in the demo instead of the original. Compare it's bump speed with the original for an example.
Posted: 20th May 2007 5:41
OK, fine.
Thanks a lot
What do you mean by implementing transparency? Do you mean refraction?
Posted: 20th May 2007 17:30
would be nice if it had reflection/refraction


That wouldn't be possible with pixel shader 1.4
Posted: 20th May 2007 17:51
Yes buti t could be done with cameras
Posted: 21st May 2007 0:29
Reflection/refraction is entirely possible with 1.4 shaders. I have a shader working right now with rflection/refraction. The shader runs perfectly within Dark Shader, unfortunately it doesn't work properly in DBPro. The scrolling of the textures across the plain are unstable in DBP. One minute they are smooth and the next, they scroll randomly at wierd angles then settle down for a few seconds and then go crazy again. I've been trying to sort out the problem for days with no luck. Maybe Evolved or GG or one of the other shader gurus can figure it out. I've also tried running the shader in FX Composer. It will compile and run but the vertexes are wrong. Attached is the shader and media (no DBP code). If anyone with Dark Shader can figure out why it runs there but not in DBP, I would be very thankful.
Posted: 21st May 2007 1:45
Spotaru, can we use this amazing but simple effect in commerical projects? Thanks.
Posted: 21st May 2007 2:38
@ Jrock

The shader is based on ocean water from ShaderX 2 book. I modified some of it for use in DBP. According to the author of the book:
Wolfgang Engel, ShaderX 1 and 2 are no longer in print and the publisher has given permission to make them open source. There is a post from him http://www.gamedev.net/community/forums/topic.asp?topic_id=440237
about this. So I'm not 100% sure, but I think it can be used. As far as I am concerned use it if you want.
Posted: 21st May 2007 4:56
Alright, thanks.
Posted: 11th Jul 2007 3:42
You're a genius. An absolute genius. I love this effect. It has almost no effect on the framerate at all.
Posted: 11th Jul 2007 4:04
Thanks, glad you like it. There is a 1.4 water shader in the following thread with reflections. The 1.1 shader doesn't work correctly in DBP. Have not figured out why.

http://forum.thegamecreators.com/?m=forum_view&t=107648&b=1
Posted: 11th Jul 2007 11:37
Nice. I'll have to use these shaders in my own projects. Good work.