Page 1 of 1

Doom Legacy Water Effect - Any Ideas?

PostPosted: Sun Jan 22, 2017 9:29 am
by Enjay
Doom legacy used to have a really cool water effect. When I say "used to have" I'm talking early, early Legacy from 1999 or therabouts. The effect created almost transparent water, a slight darkening of the light level under the water, an animation on the surface and a cool warping effect of what you could see through the water. I've always really liked the effect and seen nothing quite like it in any other Doom port or mod.

I used to have a video of it on YouTube but it's so old, low-res and compressed that you can hardly see the effect so I just uploaded a new version:



What I'd really like are suggestions on how (or if) such a thing could be achieved in GZDoom. I'm pretty sure that you could get most of the way with a 3D floor and warping textures but, as you can see from the video (I hope), the water creates a visual distortion effect too. Could shaders of some sort be used?

If anyone wants to have a look at it on their own machine, I've zipped up a copy of a suitable version of Doom Legacy and the demo WAD that was distributed to show off the water effect. Much to my surprise, it worked on my Windows 10 64 bit machine so people should be able to run it.

http://www.aspectsweb.co.uk/enjay/doom/ ... terlab.zip

For information, if I recall correctly, the way you did it in an editor was really weird. I think you had to do something odd like give the affected sectors a negative tag of the value that you wanted the depth of the water to be.

[edit] Found an old Doomworld thread where I asked about it: https://www.doomworld.com/vb/post/707308 :lol: [/edit]

Re: Doom Legacy Water Effect - Any Ideas?

PostPosted: Sun Jan 22, 2017 9:49 am
by Nash
Looks like something modern shaders can do. dpJudas to the rescue? ;)

Re: Doom Legacy Water Effect - Any Ideas?

PostPosted: Sun Jan 22, 2017 10:00 am
by Gez

Re: Doom Legacy Water Effect - Any Ideas?

PostPosted: Sun Jan 22, 2017 10:07 am
by Graf Zahl
Oh the memories. :mrgreen: Especially the last post with your horrible English translation of that bad French comment had me laughing again.

Re: Doom Legacy Water Effect - Any Ideas?

PostPosted: Sun Jan 22, 2017 10:18 am
by Beed28
Reminds me of how in the first Quake the level geometry itself warped around in underwater sections. The effect there was super trippy if anything.

And if dpJudas does do something about this, I'm going to update my wobbly shader muahahahaha

Re: Doom Legacy Water Effect - Any Ideas?

PostPosted: Sun Jan 22, 2017 3:26 pm
by Enjay
Gez wrote:http://forum.drdteam.org/viewtopic.php?f=40&t=4407 ;)


:lol: Looks like I've been bleating on about this for ages and all over the place for years. :oops:

Re: Doom Legacy Water Effect - Any Ideas?

PostPosted: Mon Jan 23, 2017 3:30 pm
by dpJudas
Ah, water effects! I suppose you could maybe create the effect using a hardware shader on a translucent floor.

The big problem are the items that are partially submerged. For those to work, I think GZDoom would have to write the depth of things into the zbuffer (maybe it already does? haven't checked) and then draw the translucent floors at the end.

To get even more fancy water effects we'd need an engine improvement where the water plane is drawn with access to the depth buffer. Basically the shader can figure out where where the fragment is by looking at its depth value and then calculate the distance it must travel in the water to reach the water plane. The further away it is, the more murky a color blend you apply.