[Community Project] WIP Weather & Water Shader

Hey guys, I have some time to spare week so hopefully I will finish the underwater stuff and upload to .
I’m actually kinda glad I did not share the version I talked about before because I have found a much better method to do the masking (which does not involve any crazy gerstner calculations in the post process material).

The solution is to use the stencil buffer to mask the upside and underside of the plane (that does require an extra depth plane though).
How the heck did I not think about the stencil buffer before?! it’s a simple solution and was right there in front of my face whole time :stuck_out_tongue:

It works like :
http://www.mediafire.com/convkey/a94b/56xw7dzionba0wazg.jpg?size_id=3
Red = upside, green = underside

The problem with method (because there always has to be a problem…) is that tessellation causes some cracks and pixelation to show in the stencil buffer, the solution is to use a pre-tessellated plane and sample multiple neighbor pixels from the stencil buffer to get a cleaner result.

Wait am I the only non-Canadian in thread? :stuck_out_tongue: haha (I’m from Greece)

The light vector for the SSS is updated from BP_Sky (take a look inside the UpdateSun function, second comment box) there is no C++ involved, you should be able to copy that part into Ultra Dynamic Sky bp.
The reason it is not updated from BP_Ocean is because it won’t update in editor when you change the time of day.

The heightmap modulation function that I posted is implemented in the materials (M_Ocean_SSR, M_Ocean_Depth etc.) I believe I posted some instructions :stuck_out_tongue: