23 Feb 2016
Again, as a way of learning a new language, I've written a Mandelbrot set visualizer. I'm really liking the language Rust so far. I hope it succeeds.
To keep the focus on learning language features and avoid getting sidetracked by the various ins-and-outs of some random graphics API, I went for an ASCII style approach for the visuals, outputting to the terminal.
A few things of note:
- The fractal data is generated on multiple threads, which makes it possible to navigate deeper into the Mandelbrot set in realtime.
- Julia is also supported, and notably, the program morphs between Julia sets by tweening the seed value.
- Given the limited 'dynamic range' of ASCII-style output, I added a kind of 'auto-exposure' logic as an experiment, which enhances the appearance of the text output considerably.
- As with the previous Scala version, I developed the beginnings of an animator/tweener class in order to animate everything possible (though I'd like to make this more ergonomic in the future).
- Rotation is supported
Last updated: 2016/3/3
17 Dec 2014
This is a WebGL shader that applies a Gaussian blur along an arbitrary angle, which makes it potentially useful for motion blur effects. I wasn't able to find any such WebGL shader on the web, which is what led to my first real approach at shader programming.
The following parameters can be set at runtime via uniforms:
- number of samples used to create the blur
- pixel distance between samples
- blur angle
Gaussian blur works by sampling and averaging color values starting from a middle point and going outwards along an axis. Points closer to the center are factored in more than those further away, such that those values form a bell curve.
In this implementation, the vertex shader stores the texture coordinates and sample weights in varying arrays that get passed to the fragment shader. This is done based on the premise that avoiding texture lookups in the fragment shader may be faster (see here). However, because there are hard limits on the amount of data that can be passed thru varyings depending on browser, it may not run in all browsers (use Chrome, in other words). Moving all the logic to the fragment shader or devising some other design compromise could get around this incompatibility, possibly at the expense of performance or flexibility.
19 Nov 2014
This is a volumetric voxel drawing library for the browser which originally started as a 'Hello World' exercise for three.js and pixi.js. It renders in 3D using three.js or in isometric 2D using pixi.
02 Aug 2014
This was written as an exercise in learning Scala and experimenting with concurrency using Akka, using Processing as the front-end library.
Also of potential interest in the source is a minimal number-tweening library written in Scala, found in /src/leelib/tween.
The video capture shows how the visualizer starts to break down as we zoom in beyond what double-precision floating point can handle.
From late 2013.
12 Jun 2014
I've been keeping a publicly viewable wiki of developer notes for a while now (running on PmWiki), but when I switched to taking notes using Google Documents, I still wanted a way to make them publicly accessible.
Drive Wiki Maker is a node.js service which generates static html files from documents on Google Drive, and makes them browsable through a public front-end.
It can run in the background on a server to automatically update documents in an assigned Google Drive directory on an interval. It also includes a front-end configuration dashboard.