Devlog 1 - Getting wet with unity’s shadergraphs
I decided to start working on my project today since I had literally nothing else to do. So i booted up unity and got started with making some terrain which turned out to be not terrible.
After that it was time for water, since my game is a fishing game I decided that water would be pretty important, and so I would spend a lot of time making sure it looks good.
Research
I did some research on how other games handle water, and after deciding I in fact did not want to struggle with FFTs i decided to use the sum of some Gerstner waves (a.k.a trochoidal waves).
I booted up desmos since it’s great for solving the math part before moving on to the coding part, and after getting something that worked I started working on making it to a shader.
( Image 1: desmos waves )
Making the shader
After playing around with the shadergraph to make sure I understood how it works I got started making the actual waves. I had to make a custom function in HLSL both for vertex displacement and for getting the normal values.
After hooking it all up I had some actual waves. Now of course this didn’t go as smoothly as described, as most of my time went into debugging and trying to understand how shadergraphs work.
( Image 2: waves in unity!!! 🥹🥹🥹)
What comes next?
So after this I want to make the water look like actual water and maybe take a look at making the waves less repetitive, although it is pretty hard to see from the players perspective. I will make sure to come back to this when I have a better idea of what it will all look like.
Anyways I’ll see you later and I hope you have as much fun making stuff as I do! ✨