Shader Projects


Fun minor projects in Unity

In my journey of learning programming, I've discovered an intense fondness for shaders. They can be very technical, yes, but they allow for an aesthetic touch that I truly cherish in contrast to some other types of programming. Most of the following shaders are written in Unity HLSL.


This project was created in parallel with the school curriculum.


JPEG Compression


In this shader I employed a discrete cosine transform, the same method used for JPEG Compression, to create the look of a low quality video or stream. I am very happy with the look of this one. I would like to reproduce it in Unreal.

Ocean


As a continuation of Paddle Panic, I created this water shader in Unreal which uses the Fast Fourier Transform to create an infinite, (practically) non-repeating ocean in 1.1 ms on a 3060. To complete this, I would like to make it dynamic based on world position (shores and such), and add a buoyancy simulation.

Posterization


In this shader I employed Bayer dithering and Hilbert dithering (aka blue noise dithering), along with user defined color palettes to create a nicely posterized image easily.

Unity_qRfz3MFbS0
Unity_TbDzQZattb

Echolocation


In this project, I created an echolocation shader that transformed auditory sensation into visual. The falloff is based on how close the player is to the target, how fast they're moving, and how strong the signal was. This could be used for a horror game where one needs to compromise between seeing and being heard.

PS2 Shader


With this shader, I wanted to emulate the look of the PS2. On the box, you can see (PS1 style) Affine Texture Mapping, and especially on the sphere, you can see vertex jittering.

In addition, the palette is crunched down and some sharpening is applied.

HLSL Erosion


Inspired by Sebastian Lague, I set out to create an Erosion Compute shader in Unity. This was the result. It's very slow, but of course the finished product is saved as an image that can just be loaded.

Procedural Terrain


As a continuation of the previous project, I wanted a fast kind of terrain generation that can look eroded without having to actually run any simulation. In my research I came upon the monumental dissertation of F. Kenton Musgrave that tries to tackle this exact problem. I used it to generate a lunar landscape.

Ray Marcher


In this project, I created a simple ray marcher that I used to render a Mandelbulb Fractal.

In the future, I would like to use this method to render a planet. This would circumvent a lot of issues with planet rendering such as lacking geometry.