Old Projects
This page documents some of the smaller projects I worked on between April 2022 and February 2023 while learning graphics and GPU programming in my freetime. Since I don't have much to say about these, I don't think each needs its own page. Instead, I grouped them all here.
Editing time of day in interactive 3D fractal path tracer. Made with WebGPU.
1. 3D Cellular Automata
This was my first graphics project. Unfortunately, I do not have any screenshots or video recording of it, but a demo is available here. It used JavaScript to run a 3D voxel cellular automata and WebGL to ray trace it in real time.
2. Constraint-Based Procedural Generation
This project used an algorithm similar to wave function collapse to procedurally generate models from a simple tile set. Then, it path traced those models in real time using WebGPU. While there isn't anything too interesting here, one thing to note is the ray tracing acceleration structure used; since a scene consisting of tiles is naturally spatially partitioned, I didn't use a BVH as an acceleration structure. Instead, I stored a grid of "pointers" to tiles, and the ray tracing function marched through the grid, testing intersections against only those tiles it passed through on the grid.
The demo for this project can be found here. In the future, I'd like to revisit the topic of procedural generation.
Procedural generation algorithm running on 8x8x16 model. Path traced with WebGPU.
3. SDF Path Tracing 1
This is by far one of my favorite projects. It is a small site for creating, editing, and path tracing 3D fractals using WebGPU. While the demo is available here, be warned that the code is very inefficient and slow. That said, it is still capable of generating very interesting images:
Path traced 3D fractal - "Kleinian Group Limit Set".
I have written a brief overview of how to interact with the demo here. One of the core features of the demo is the editor which allows users to write their own fractal SDFs; in addition to the default fractal, here are some additional examples. The path tracing uses a Preetham Sun-Sky model to approximate the atmospheric scattering that gives sunsets their beautiful colors. The first video on this page, as well as the image below, show examples of the changing color of the sky as "time of day" changes.
Path traced 3D fractal - "Mandelbox". Note the color come entirely from the sunset skylight: the underlying model is white.
Path traced 3D fractal - "IFS".
4. WebGL Voxel Fractals
This was my first attempt at real time ray/path tracing. Initially, I did 1spp path tracing + temporal reprojection + spatial denoising. However, the denoising blur was too strong and did not look very good at sharp boundaries. Also, it ran pretty slowly.
256x256x256 voxel scene path traced and denoised in real time. Note the blurred shadows and little distinction between individual voxels.
Eventually, I switched away from path tracing and instead just traced a shadow ray and a few, shorter ambient occlusion rays. The raw result looked something like this:
Input to denoiser. 3 AO rays per pixel, 1 jittered shadow ray per pixel for soft shadows.
Because the input was significantly less noisy than the raw path tracing input, the denoising kernel could be a lot lighter. Overall, this helped the performance a lot, but I still feel there was a lot more room for better performance.
Ray traced ambient occlusion and soft shadows for voxel dragon model.
The actual procedural generation algorithm is just a port of this. The fractal generation and acceleration structure building happens on the CPU. The demo is available here.
Ray traced 3D voxel fractal.
5. PBR
This was the first path tracer I wrote based on the book Physically Based Rendering: From Theory to Implementation. I used Oren-Nayar diffuse BRDFs and Next Event Estimation/Multiple Importance Sampling to realistically render 3D fractals. Unfortunately I don't have a demo for this project, as it was mostly just a single file that I worked with while reading through parts of the book.
Path traced Mandelbulb with soft area light.