A Pirate-themed third-person platformer inspired by A Hat in Time that we made in 13 weeks half-time with our Custom Engine: Lamp Engine.
Creating a good-looking water shader in a Custom Engine was a challenge. I did some research into Signed Distance Fields, which is a common technique when making stylized water shaders in Unreal and Unity, but it was not available in our engine. I had to find another way. To create the edge foam, waves and depth fade, I use pixel data from the Geometry Buffer to get the distance between the underlying pixel and the water's surface.
A problem with this was that it became based on the camera's current rotation and the angle at which the water was viewed, which looked weird. I solved this by only calculating distance for the up-axis to remove the camera dependency, and it worked pretty well!
The waves are made with depth data, adding time and frac to make a moving gradient, and adding noise to it to create a foam effect. The big "wind waker" caustics are just a few tiling patterns, scaled differently with some UV distortion.
A lot of the techniques I used in the Ocean shader are also used for the whirlpool in the final level. I also use more aggressive UV animation to swirl around and a depth fade towards the bottom to blend it all together. There is also a lot of debris floating around in the whirlpool, which interacts well with the regular depth fade.
All waterfalls and geysers use the same shader. A panning texture with the same water pattern and customizable direction. It has a slight gradient based on its UV-height, which gives it more depth. I used a bunch of waterfalls stacked on top of each other to create the rapids in the last level.
Early in the game, the player unlocks the Ghost Vision ability, which lets them interact with Ghost Objects nearby. The spherical outline applies to everything using the deferred pixel shader for the master materials. We thought of using a decal in the beginning, but went for this approach to make it look good above and below Maruk as well.
I added the glowing eyes and tattoos using an emissive mask and made some ghost particles around him.
The Ghost Object and its inverted version both use the same shader with different colors and their opacity is flipped. The erosion mask is made by combining two noises and panning them in different directions. The same noise textures are also used to make the solid texture feel smoky and ethereal. It is also a world-tiling material and works well on different objects at different scales.