Helped out with graphics programming on The Falconeer.

The Problem

It was impossible to have both shadows cast on the water and foam that surrounds the shorelines. This was because the shaders that were generated by ShaderForge needed to be in the Transparent Queue to do a Depth Blend. The transparent queue cannot automatically receive shadows, because it is so late in the render queue.

The Solution

The Falconeer mainly uses a single directional light source. A script which runs a custom command buffer is attached to the light and it basically calculates all the shadows it will cast every frame and dumps it into a large render texture. This render texture is then set as a global shader variable, after which it can be read by a couple of lines of custom code in the ShaderForge graph. What you end is an accurate reading of the light level at any particular point on the ocean, which can simply be inverted and substracted at the very end of the graph to give an accurate shadow. It even gives you more control over how much shadow should be visible and at what distance of the player. The overhead from updating the render texture is minimal and it all still fits in a single pass.

This thread was super helpful in figuring out the solution. And I borrowed some shader code from this project the light data to accurately light surfaces with fancy interior mapping.