Session 005 - A Box School

SESSIONS is a project consisting of individual sessions of WebGL programming, with the goal of focusing on being prolific, and creating some kind of output.

Launch Session Code on GitHub

Getting access to a lot of the raw power of shaders is quite fun. In this example I used instancing support to draw lots of boxes. It re-uses much of the code from the previous example, but implements the same logic with actual box meshes. I got some grief for not doing this the “proper” way as I could eek out more performance, but that’s not the point of these anyway. It’s funny how a series of sequential works can turn into quite a complicated example. These boxes want to stear towards a certain location, but they are also compelled to move in a direction according to some noise functions. The dueling forces cause them to retain their original color layouts as over time the similar colored boxes tend to want to head to the same locations, but the noise is constantly working to split them up.

More From interactive

More Posts