Particles, Compute Shaders and D

For the last month or two my main obsession has been over the language D. It’s near enough to c++ that there isn’t too much of a commitment to learning it’s quirks, but it’s different enough in just the right ways that it’s wonderful to use. If you haven’t tried it already, I seriously recommend it. It brings a lot of expressiveness and really nice features from higher level languages yet maintains the freedom and efficiency of c++ and the like. It is, in my opinion, a worthy successor of c++ as the industry standard, general purpose language.

I’m beginning to use it as much as I can in side projects and eventually I hope to bring it into my uni work (and convert my class mates). I’ve done quite a few small things with D in which I’ve learned about binary file formats, FFT’s, and how to not use opengl like a (complete) noob. I’m finally getting a handle on opengl’s api and how it all fits together and as such one of my projects showcases a relatively new feature in opengl which is the compute shader.

’tis a particle thing. All of the movement and colouring is done on the GPU in a compute shader. The only time the CPU intervenes is when uploading new particles or attractors so there’s very little copying around (unlike one of the first iterations which involved copying the entire particle buffer back to RAM, updating it, and reuploading it every frame), so it has relatively good performance. I’m pretty happy with it.

Here is all of my D stuff, and here is the particle system thingo.


Hello, I’m Patrick Monaghan, a games programmer in training. The purpose of this blog is to track the progress of my various projects relating to game development and various experiments I decide to try.A little bit about myself, I'm fluent in c++. I'm familiar with a few other languages also. I have a working knowledge of blender and gimp, thus can pump out programmer art like it’s going out of style. I’m always willing to learn new things and I always welcome feedback if it means I can improve. Also, here's a youtube channel And my github And my soundcloud Also I'm @_manpat on twitter Finally here's a todo list that I'm putting here so I can't ignore it

One thought on “Particles, Compute Shaders and D

Leave a Reply

Your email address will not be published. Required fields are marked *