Hari's Portfolio   |   Real-Time Sand Dune Simulation

Project Overview

This is a GPU-based model of a cellular automata algorithm where dunes procedurally emerge on a 2D grid, based on rules such as wind-driven sand saltation, probabilistic deposition, wind-shadow zones, wind warping, avalanching, and base terrain. The grid is represented by a 2D integer array where each cell stores the height value of sand deposited onto it, forming a heightmap.
This data is mapped to a texture where colours are assigned based on the height value of each cell and is later rendered as a 3D mesh using vertex displacement. This system can also be layered upon other grids representing different terrains.

Unity C# HLSL Compute Shaders PCG Award Winner
Responsibilities
Graphics Programming, PCG Programming, Technical Artist
Development Time
6 Weeks
Grade
Distinction
Awarded Title
2nd Place - Games Computing Award, GradEx 2026

Systems and Features

What I Learnt

Initially, this system was written in C# which had major performance issues as it had to run the cellular automata algorithm for about 500K+ times per second on the CPU to produce decent results, and increasing the grid size made it impossible to run. This problem was solved by using Compute Shaders written in HLSL, which runs on the GPU to parellely process the simulation. The GPU version performed significantly better, it managed to run the algorithm accross 4M+ cells per frame and gave 200FPS which means the total amount of calculations were 800M+ (4,000,000 cells x 200 frames per second). Making this transition from C# to HLSL was quite challenging as I have limited experience with shader programming, so this was a steep learning curve. I also made a seed-based basic solar system generator along with a perlin noise terrain mesh generator in the process of practicing PCG code beforing starting this project yo get a grasp of how PCG works.

Future Work