Forum rules
The Projects forums are only for projects. If you are asking questions about a project, either find that project's thread, or start a thread in the General section instead.
Here's a very light (on system resources) animated water shader, with cartoony fake caustics effects and nice specular highlights. Compatible with Zandronum, GZDoom 1.8.6-2.4 (using the Zandronum version), and GZDoom/LZDoom 3.x (or newer, using the GZD version). In the Zandronum version, this shader replaces warp2, the GZDoom version functions like a regular hardware shader and doesn't replace any functionality.
It's called "Mario Galaxy-esque" because it uses the same technique as that game does, with some slight tweaking.
Preview: (click the image to enlarge)
The texture SMGWATER is used for opaque blue water (like in the screenshots) while SMGWTXLU is used for translucent water (like in the screenshots), which doesn't have any color by itself (it's blended in with whatever is under it).
Spoiler: Installing the shader into your mod
If your mod is only compatible with GZDoom, then you can throw in the contents of the shader .pk3 for GZDoom into your mod .pk3, and you're all set. Same if your mod is only compatible with Zandronum, except you use the contents of the Zandronum version of the shader.
As a special note, the Zandronum version of the shader is still compatible with current GZDoom, so it's going to be compatible with Zandronum for a very long time. So while the best practice for cross-port compatiblity is including a dependency on the shader .pk3 (and the one that gives the best results), nothing should break for the forseeable future if you just use the Zandronum version.
Spoiler: Usage guide
To have opaque blue water, merely using the SMGWATER texture is enough.
However, more complex effects can be done with translucent water. Here's two I've currently made:
Reflective water with Sector_SetPlaneReflection (NOT SWIMMABLE):
1. Make your sector with the water floor that's going to be reflective.
2. Set up a normal 3D floor on this sector with exactly 254 alpha (or one less than the max, in case it's not the same in Doom Builder X compared to the others), SMGWTXLU set as it's top flat texture, and - (a.k.a none) as the bottom texture. Make sure the 3D sector has no height (identical floor and ceiling height values), and is one unit above the floor of the target sector.
3. Then the sector that has the 3D floor applied to it should have Sector_SetPlaneReflection assigned via ACS. If you want to add some tint, use a solid-color texture of the desired color, and tweak the Sector_SetPlaneReflection reflectivity amount until you're satisfied with the resulting color.
If you don't want any tint on the floor, just use 255 as the reflectivity amount.
3D floor water (swimmable):
1. Make your 3D floor water as usual, except you must set the top texture to SMGWTXLU. Set the control sector's light color to whatever color you want the water to be, and that's pretty much it. Add the "render inside" flag if you want the water surface to be visible from underwater.
But that doesn't have to be all, you can add some warp with ANIMDEFS to the walls and floor of a 3D floor water pool to make a slightly more convincing water effect, or use some cubemapping shader + warp to make a lightweight realistic reflective warping water surface. The limit is your imagination! (and GZDoom/Zandro's own limitations, sorry!)
Spoiler: Known issues
-Fog effect in 3D floors is not supported, and displays a single incorrect color for the water surface in both Zandro and GZDoom. This can be worked around by making the water surface a separate 3D floor that just displays SMGWTXLU, is zero-height and is one unit above the actual water.
-Zandronum doesn't draw pixels I set to have less than 0.5 alpha, so the effect for translucent water had to be made less subtle in that port. It's otherwise perfectly functional in the same way the GZDoom version is.
Spoiler: Credits
Michael "Jasper" Ashworth: His amazing breakdown on how the Super Mario Galaxy water works. This shader is mostly based off his explanation.
Download: SMGWaterShader.zip
Comes with test map smgwater_test.wad, goes over MAP01 and uses Doom 2 resources.
Last edited by TDRR on Thu Dec 17, 2020 1:17 pm, edited 1 time in total.