Skip to content

Boids Update March 9

Posted on: March 9, 2025 at 10:00 AM

The birds on my site got an update. A couple things: I iterated on instancing logic. At first, there is no instancing, and I had a glDrawArray for every bird on the page. But I refactored the shader to take in instanced buffered data of model matrixes for the birds. This allowed about a 10x amount of birds that could be simulated and rendered.

In addition, I refactored kd tree logic which allowd for quick querying of neighborhoods of birds.

Lastly, I refactored the astro component that hoists the rendering onto page to also parametrize into the dom the number of birds that should be rendered.

I still need to tweak the default parameters and clean up the code some more, but I think its in a good place for now.

Some todos:

Also, I am planning my next themed renderable on the site next. So far, I have created the rain of hearts, the cube, a tetris clone, and a wordle clone.

A change is as good as a rest.