Procedural Generation

Project Description

This project actually started out as my Bachelor's degree dissertation - a terrain generation system using C++ and OpenGL. Since then, I've been reworking and expanding it in Unity. At the heart of it is the Diamond-Square algorithm, which I've adapted to work with a chunk-based terrain system. Each new chunk gets generated by using the heightmap data from the edges it shares with neighboring chunks, which helps everything blend together smoothly.

At first, I wrote everything using C# scripts, and it worked pretty well. But every time a new chunk was generated, there was a noticeable pause while the terrain was being built, which wasn't ideal. To fix that, I moved the heavy computation over to Unity's HLSL compute shaders, which let the GPU handle the intensive parts. That change made a huge difference in performance and made the chunk generation much smoother during gameplay.

It's been a fun project to work on, and a great way to dive deeper into procedural generation, GPU programming, and the inner workings of Unity.