Projects tagged "graphics"
This page highlights several of my personal software projects.
Table of Contents
Physarum Simulation November 2020
Particle-based simulation of slime molds.
Inspired by Sage Jenson's article on simulating the Physarum polycephalum slime mold. The algorithm is surprisingly simple, given how complex its outputs appear. That's the magic of generative algorithms! There are several configurable parameters, which are randomized for each run. This would be a great candidate for running on the GPU, but my implementation is purely CPU-based and written in Go. There is an OpenGL-based viewer, however, so you can watch the simulation as it runs. A lot more could be done here... food sources, life & death, evolution, etc.
Links: GitHub
Domain Coloring March 2018
Visualize complex functions by coloring each point in the complex plane.
This was a quick experiment inspired by 3Blue1Brown's video called How to solve 2D equations using color. The colorings are based on the magnitude and/or phase of the complex numbers transformed by a function. The coloring algorithm can be as simple or as complicated as you can imagine, providing plenty of room for creativity.
Links: GitHub
FauxGL January 2017
3D software rendering in pure Go. No OpenGL, no C extensions, no nothin'.
It's like OpenGL, but it's not. It's FauxGL.
It doesn't use your graphics card, only your CPU. So it's slow and unsuitable for realtime rendering. But it's still pretty fast. It works the same way OpenGL works - rasterization.
I mostly wrote this for fun and for learning, but I've already found it useful in other projects.
Features
- STL, OBJ, PLY, 3DS file formats
- triangle rasterization
- vertex and fragment "shaders"
- view volume clipping, face culling
- alpha blending
- textures
- depth biasing
- wireframe rendering
- built-in shapes (plane, sphere, cube, cylinder, cone)
- anti-aliasing (via supersampling)
- parallel processing
Links: GitHub
Primitive September 2016
Recreate your photos with vector-based geometric primitives.
You provide an image as input. The app tries to find the most optimal shape that can be drawn to maximize the similarity between the target image and the drawn image. It repeats this process, adding one shape at a time. Using this process, the program can recreate a photo with surprisingly few shapes.
This project was originally inspired by the popular and excellent work of Roger Johansson - Genetic Programming: Evolution of Mona Lisa. Since seeing that article when it was quite new, I've tinkered with this problem here and there over the years. But only now am I satisfied with my results.
The core is written in Go and is open source. A native macOS app is also available in the App Store, providing a nice UI on top of the engine as well as some additional features like "drawing mode." To date, this has been my most successful paid app.
Links: GitHub • Website • App Store • Twitter Bot
Go Graphics February 2016
Cairo-inspired 2D graphics library written in pure Go.
Go has an excellent set of image packages, but what do you do when you want to render 2D graphics? The golang freetype library implements nice anti-aliased rendering of paths, but is primarily for drawing text. So I built gg
on top of it to provide a nice, general purpose 2D graphics API inspired by Cairo.
Features
- Anti-aliased rendering
- Fill and stroke paths
- Draw images and text
- Built-in word wrapping
- Line caps, joins, dashes
- Gradients and patterns
- Transformation matrix
- Push and pop context state
- Clipping regions
Links: GitHub
Traveling Pixel January 2016
Applying the traveling salesman problem to pixel art.
This code uses simulated annealing to find the shortest path to visit all black pixels in an image. Then it generates an animated GIF showing the order of traversal.
Links: GitHub
Pirate Maps December 2015
Procedurally generated pirate treasure maps. X marks the spot!
This was my submission in the /r/proceduralgeneration monthly challenge. I used several excellent third party libraries...
cairo
for renderingcolour
for color interpolationnoise
for simplex noisePillow
for saving debug images of noise layerspyhull
for delaunay triangulationShapely
for all kinds of 2D geometry operations
Links: GitHub
Path Tracer January 2015
CPU-only, unidirectional path tracing engine written in Go.
This was the first thing that I wrote using Go and I've been loving it ever since! The inspiration for this project came from Evan Wallace's WebGL Path Tracing.
- Supports OBJ and STL file formats
- Supports textures, bump maps and normal maps
- Supports raymarching of signed distance fields
- Supports volume rendering from image slices
- Supports various material properties
- Supports configurable depth of field
- Supports iterative rendering
- Supports adaptive sampling and firefly reduction
- Uses k-d trees to accelerate ray intersection tests
- Uses all CPU cores in parallel
- 100% pure Go with no dependencies besides the standard library
Links: GitHub
Tiling June 2014
Quickly construct tilings of regular polygons and their dual tilings using a simple API.
This code provides an interesting API for constructing tilings of regular polygons. It can also render the dual tilings.
Links: GitHub
Quads May 2014
Computer art based on quadtrees.
The program targets an input image. The input image is split into four quadrants. Each quadrant is assigned an averaged color based on the colors in the input image. The quadrant with the largest error is split into its four children quadrants to refine the image. This process is repeated N times.
Links: GitHub • Web Version
AllRGB March 2014
Generate images that use all 16,777,216 RGB colors exactly once.
Efficiently create AllRGB images that target an input image. The input must be 4096x4096px. The output will also be 4096x4096px and will contain all 16,777,216 distinct RGB values once and only once.
See allrgb.com for details on the concept.
Links: GitHub