3D Animator and Game Developer Paul Jeffs shared a detailed tutorial on stylized water visualization in Unity.
3D Animator and Game Developer Paul Jeffs showcased the creation of a shader inspired by Sea of Thieves in a Reddit post. The artist explained that physics, fog, reflections, looping of simplex bump texture, and infinite async procedural terrain are made specifically for the project. The artist further shared that the goal of the project was to get better at visuals in Unity, noting that the project only involved built-in rendering pipeline without any visual scripting software like Shader Graph, and anything other than Unity and Visual Studio was not used in the project.
In the original Reddit post comments, the author provided a detailed breakdown of the project, dividing the steps into several parts, which can serve as a tutorial for creating high-quality water simulations.
According to the artist, the starting point was a transparent flat plane, followed by calculating the depth of water and lerping from a background color, which was obtained from a GrabPass, to the water color using an exponential function. Four Normal Maps were generated using simplex noise, two with large-scale noise, and two with small-scale one. The noise was made look seamless by creating four textures and lerping them together. The Normal Maps were moved across the surface in opposite directions as the small-scale noise moved slower than the large-scale one.
To improve reflections, the artist used Screen Space reflections. The screen position of intersected rays spotted with the depth buffer was used to read from GrabPass, which provided the reflected color. As for adding fog, the author noted that is important to ensure that it affects water and matches its color. To do this, the artist calculated the fog manually in the water's fragment shader and lerped the color of the water to the fog color.
Waves were made using two layers of trochoidal depending on their size and impact on the water flow. Waves simulation was completed utilizing a C# script packed in a struct and sent to the GPU. The small waves are visualized using the noise textures, which were used to create the surface normals, with scaling the noise to create large and small patches and mixing them.
For creating buoyant forces, the artist utilized the following formula: the force is equal to the weight of the fluid displaced. The goal was to make the boat move so that if its front is not submerged, it should dip, for instance. The artist modeled the volume of the ship as a group of cuboids.
As the artist states, the objects in the scene are moved back towards the origin to prevent floating point errors when the player moves far from the origin. To make it unnoticeable, the artist decided to offset the Ocean Mesh. Async methods were used to generate new terrain appearing as the player makes their way through the environment.
According to the artist, the project took at least a year. Future plans involve expanding the environment: improving the terrain, creating a skybox with clouds, creating 3D assets for the boat and player, animating the sails, and adding sound.
Read the original breakdown here and join our 80 Level Talent platform and our Telegram channel, follow us on Instagram, Twitter, LinkedIn, TikTok, and Reddit, where we share breakdowns, the latest news, awesome artworks, and more.