Create Your First Project
Start adding your projects to your portfolio. Click on "Manage Projects" to get started
Ocean Shader + Buoyancy Project
Unreal 5 | Tech Art | Programmer (BP & HLSL) | Solo
A custom ocean shader and buoyancy system created in Unreal Engine 5 with material editor and blueprints. The project makes use of various mathematical equations and an algorithmic approach to to build realistic looking and feeling ocean surfaces that are not only performative but also quick and easy to set up.
The shader is fully customizable from a selection of 40+ parameters that control every aspect of the ocean surface such as, Wave configuration, Colour (through Single Layer Water), Normals maps, Opacity, Roughness, Specular, Refraction, Wave Foam, distance fields Caustics as well as a switch to run the shader in Real time or control through BP (Used for Buoyancy).
A custom HLSL node was written to handle all wave generation for an iterative approach to stacking waves vastly reducing the set up complexity of the shader resulting in an artist only having to set up one wave instead of setting up each stacked wave individually. This is achieved with a for loop and summing up of Gerstner waves up to the specified amount by the artist. Techniques such as Fractional Brownian motion and domain warping are used to algorithmically stack realistic acting waves onto each other to build the ocean surface. The Jacobian result is also calculated through this node allowing for the placement of realistic wave foam and colour variation.
Buoyancy is achieved by recreating the wave generator in a Wave Manager BP and gathering the same parameter setting from the material to achieve the same waves produced from the material onto the CPU to be used for Physics. A custom made buoyancy component is then used to sample the wave height at a given point and then apply the relevant buoyant force to a pontoon float on the owning actor. By making a custom component for the buoyancy any object can quickly be made to float in correspondence to the shader by a developer saving dev time and preventing repeatable code.
Throughout this project I faced a fair few challenges to get the results that I wanted. The biggest challenge to overcome was developing the solution to having to set each wave up individually and taking the algorithmic approach instead. From early versions I had a Gerstner wave material function that created one wave which could be summed together with another to create a surface with 2 waves. But this proved a problem when wanting to add more detail to the surface as you had to add more and more waves, which all required manually setting up which consumed a large amount of time and realistically was not feasible past 6 waves due to the micro adjustments that had to made to each wave and growing list of parameters. This resulted in me searching for a better solution, where after time spent researching Fractional Brownian motion and Algorithmic approaches in shaders I created the HLSL node which would simplify the set up process and allow the user to add as many waves as they would like while only needing to set up one.

















