lookaround
As a side-quest, the computer architecture professor challenged us to “make something related to parallelism on the GPU”. It was a completely open ended challenge, so I decided to take it and make something fun.
I had a couple inspirations / driving factors:
- Last semester, on the parallelism and concurrency subject (which I know is taught by the same professor), they made a program to calculate images of the Mandelbrot set using parallelism on the CPU.
- This semester I was also doing a graphics programming subject, so I was getting familiar with shaders
- I wanted to try making something with WGPU+Rust
So I landed on making lookaround. A real time, interactive render of the Julia set, which is the Mandelbrot’s “sister”. From what I’ve gathered, on the parallelism and concurrency subject, they only generated PNG files of the whole shape, so this is quite a step up.
Initially, I wanted to do this using compute shaders, but it got really annoying to work with really fast. I fell back to using a fragment shader, which is the easy option, but since it was a side quest I ran with it. Especially since I was quite overwhelmed with other uni tasks.
Working with wgsl was a bit more “enjoyable” than the glsl I learnt in
class, since it has a more Rust-like syntax. Although I wish it had 64 bit
floats, since that would have allowed me to zoom in further before hitting the
precision limit. The correct way would have been to implement an arbitrary
precision decimal to make zoom infinite, but oh well, it was a quick side-quest
after all.
Despite the fact that I couldn’t figure out how to make it work on wasm without having to completely rewrite it, I’m happy with how it turned out. It’s got great performance and it’s fun to play with.
I wrote a little IEEE journal-style paper on it and I ended up getting a 10/10, so that was a whole bonus point on my total grade :D