Personal Projects




- Shader Projects -


Gerstner Waves - 2021 & 2022


Also known as Trochoidal Waves, Gerstner Waves are an equation for creating more realistic and visually interesting Ocean Waves. In stark difference from Sine Waves, Gerstner Waves feature sharper peaks and flatter canyons.

They function by practically rotating around vertices in a circular pattern, if we free them from matching this position exactly we can create more interesting Ocean Simulations, but this project never reached such depths.

What really got me into Gerstner Waves was the game Sea of Thieves [Rare, 2018], they were so stunning that one could watch them for hours on end .

Wikipedia, 2023-01-01. Wikipedia - Trochoidal Wave [Website].

https://en.wikipedia.org/wiki/Trochoidal_wave

The Project was done in Unity utilizing Unity's Shader Graph and its Script Plugin node.

By doing this we can have a global OceanManager Script that contains the Ocean equations, which both the Shader and other Scripts can sample from.


The following image depicts some early versions of Gerstner Waves and different versions of it.


If you'll excuse the Potato Quality of these ancient videos, here we have some demonstrations of the Shader:

Here's a breakdown of what is in the Shader:


3 Wave Functions

By layering 3 different Gerstner Wave functions, (in different Scales, Speeds and Amplitudes), we can give a visually interesting depth to the Waves that makes them feel less repeating.


Fresnel

A small and weak Fresnel Effect is used to give the peaks of the Waves a glossy look as if they're reflecting the Sun.

Noise

A smaller Noise Texture is used to add dark spots to the Ocean.


Height-Based Color

A local-space check that lerps the color based on height.


Depth-Based Color

A depth-check from the Camera which colors the Ocean if it's Shallow, or near an object that sticks out of the Ocean. (This is visible in the next subject).


Something which got me really excited was when I started working in Gameplay in conjunction with the Shader.


It took me a while but I created a Buoyancy system for making things float on the Ocean. (Again, forgive me for the Potato Quality)

By creating a set of "Buoyancy Points" and a Center of Mass we can sample from the OceanManager script and create realistic Buoyancy. Each scattered point around the ship checks if they're underneath the Ocean Surface, and tries applying a force upwards if they are, and vice versa if they're above the Ocean Surface.

There's also a funny looking Player on the Ship, which isn't directly affected by the Ship's physics ;)


Day/Night Cycle - 2022


Building on the same Project as the Gerstner Waves, I created a Shader which was applied to the Skybox to simulate a Day/Night cycle.

This shader samples from a global Script that handles the daytime, and blends between different skybox presets based on the time of Day. We can also hook up other systems to the same GlobalDaytime script, like blending out the clouds when it becomes Night and rotating a Sun & Moon light around the entire world, while changing the Post Processing.

(Click to Enhance)


Tessellated Grass - 2022


Keeping to the same Project, I did some experiments with Tesselated Grass and achieved a pretty good result.

Tessellation is a way of creating more vertices on a surface, which can in this case be used to create Grass Straws. All of the work is purely done on the GPU here, and the shader was written in an HLSL Compute Shader and then inputted to Unity.

This leads to rather performant grass, (for the millions of Vertices being created), and was quite visually appealing. By using a scrolling noise function I was also able to make simulated Wind, and another texture could be used on a surface to determine what parts should have generated grass or not.


- Project ARENA -


Visual Studio + Unity Networking - 2021-2022


A learning experience where I set out to create a Server Structure using Visual Studio as a Server Host and Unity as Clients.

This Project was really insightful as I created the structure from the ground up, using Visual Studio's UDP & TCP support. The project revolved around a simple Arena Shooter where multiple characters could run around and shoot each other, where the backend code could send both TCP and UDP messages depending on what was better.


Most of the Project's time was spent making different and efficient Packet Encoders and Decoders for the various different types of Data one could send, as-well as some custom Packages which were tailor-made for the specific gameplay.

It was also somewhen during this time that I re-used the code to create a Multiplayer Card Game much like Hearthstone [Blizzard Entertainment, 2014] in a Visual Studio Engine named SFML. This Project was structurally different due to one of the players automatically becoming a Host when the matchmaking put them together, but otherwise the Data transfer was done much in the same way.

2 Clients standing Face-to-Face.


Toon Shaders - 2019-2020


For this Project I created:

  • A Toon Shader
  • A Water Shader (using Sine Waves)
  • An Energy Shield Shader

They're simple implementations that are well documented online, so I won't go in-depth about them. They also happen to be made during the beginning of my career in Game Development and I don't have the best documentation about that era.

(Click to Enhance)


- Project NEBULA -


Spellcasting Shaders & VFX - 2021 & 2022


This Project was based around the 4 primary elements; Wind, Water, Fire & Earth. (Long ago, the four Nations lived together in Harmony...)


Unfortunately I don't have much visual documentation about this Project, but I designed a moveset for each of the four elements consisting of 3 basic abilities and an ultimate. I really do wish I could show all of the abilities, but alas, it's something to be angry at the past version of myself.

It was really fun developing and I'd eventually like to use a similar system in an actual Game. It would be an RPG centered around Sailing, Swordfighting, and Magic.


Evolution into ARCHMAGE - 2022


Project NEBULA was eventually used as my basis for Project ARCHMAGE; my Graduation Thesis at LBS. You can read more about it on its dedicated page.