We’ve been following the progress of Alexey Testov, who appears to be working on some game with stunning visuals, including this lighting shader and a weather system. Now, he has showcased a new water shader that complements the scene beautifully and shared some details about how it was created.

The system relies on two noise textures multiplied together to create variation. The resulting noise range determines depth, and the water level is set using a smoothstep function. Any area below this threshold is considered water, while areas above are treated as land.

“I also define things like foam areas, a wet shoreline strip, etc. For example, if the water boundary is 0.49-0,51 in the depth mask, then at 0.45-0.5, I darken the ground texture to create a ‘wet’ strip. At 0.6-0.9, I add noise for waves, so there are no waves in shallow water (0.5-0.6), and they gradually appear as the water gets deeper”, commented the developer.



Source link

Podcast also available on PocketCasts, SoundCloud, Spotify, Google Podcasts, Apple Podcasts, and RSS.