So I have been working on some special dampening fields generated by sampling associated terrain/island heightmaps, which allows the water shader to generate an approximation of water-depth based on the height of the displacement map beneath it. Using this data I was able to dampen wave form wavelength in shallower waters, and reduce wave steepness; in real world physics waves are stacked oscillations depthwise and as they approach shallow water the rotational energy is compressed until it begins to move forward faster on top than below, resulting in wave crests crashing and 'breaking'! Unfortunately the nature of mesh geometry makes this nearly impossible to replicate properly with a simple equation, so we dampen the wave forms steepness and increase velocity to help ease the wave into the shoreline without overstacking them, especially when multiple waves are layered. I was also able to rethink and rewrite my fresnel foam code, after constantly trying to get a more bold and vibrant edge out of the previous calculations I realized that I could sample the vertex shader sin(f) equation and capture all positive high values to generate a gradient mask of all wave crests, and accumulate those to be multiplied by the previous fresnel calculations, resulting in nice solid stylized wave edges and the ability to sharpen/soften them through an exponential on the mask. Using the new psuedo-depth calculations I spent some time messing around with a few other components of the calculations, ultimately rewriting a few but nothing super major visually, and I enabled SubSurfaceScattering to help add some additional color to the water while in full-light, not sure how I feel about it yet though.
Next step: I want to experiment splitting the shader into more than one shader. I want to attempt to create a 2D wave form simulation shader and render it separately to a double buffered texture, which can then be sampled itself into other shaders, such as a greatly simplified displacement vertex shader to generate the wave shape in 3D from those calculations. This may ultimately be more costly performance-wise, but it should produce a resource that will drastically decrease the cost of further wave calculations for additional shaders and effects, i.e. being able to create a shore-line 'wetness' shader, and calculate accurate water-height values for buoyancy physics, and there is the possibility that the innate 'rounding' of casting vertice floating point values to pixels will also help 'soften' some of the overly sharp steepness of some wave forms at odd angles to the mesh. We shall see this week.