06 Jul 2017
I started on this to do more with shaders and GLSL. My hope is that over time, I'll continue to add on to it with new ideas, etc.
This builds off learnings made thru the course of developing
Aurora Timelapse and the
other Live Data live wallpapers for the Google Pixel launch last year.
Written in Kotlin, of which I have no complaints. Uses (and requires) Open GLES 3.1.
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:
- 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.
- The fractal data is generated on multiple threads, which makes it possible to navigate deeper into the Mandelbrot set in realtime.
- As with the Scala version mentioned previously, 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 (using the '[' and ']' keys)
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.