Water Shader Programming
AlienScribbleInteractive
A [sleep-deprived] brief explanation about how to program dynamic water with animated caustic, rim-lighting, reflection and distortion effects using a pixel shader and using c# & xna/fna/monogame. This one was done using the cross platform desktop project template. Dynamics of water is based on work by:
Michael Hoffman: https://gamedevelopment.tutsplus.com/tutorials/make-a-splash-with-dynamic-2d-water-effects--gamedev-236
Background lighting fx (Crepuscular rays) are not covered in this tutorial - but you can find out about those by checking out work by Charles Humphrey: http://xnauk-randomchaosblogarchive.blogspot.ca/2012/10/2d-crepuscular-god-rays.html
Source code and other information can be obtained at my site: http://www.alienscribbleinteractive.com/Tutorials/water_tutorial.html
Color Communication Notes: Btw - I should have mentioned that color values are dwords(4 bytes - 8 bits/channel so 0-255 for each byte) -- the shader stores the color channels as floating point but for a 32 bit color initially passed, each channel is actually only 8bits precision (unless using custom vertex with 128bit color which might be less efficient). 0-255 is enough precision to make the effect work but if you need more precision you may need to combine multiple channels (ie: adding bit shifted values)
When I made this video, I had not slept for a couple days so I was very sleepy and you can tell by my voice. XD
156240576 Bytes