Skal's corner — code snippets & demos

My day-job is — amongst other things — writing open-sourced code (like webp or sjpeg). But I also write open-sourced code for fun :)   Here are some side-project demos.

Recent

Instant-NGP
Instant-NGP — in-browser training
Neural-net compression: an online Adam trainer for embeddings + MLP that learns an image's representation and reconstruction.
Gaussian splats
Gaussian splats (3DGS)
The new cool in scene rendering — my WebGPU version, and a good excuse to play with GPU compute passes.
Sensor Network Localization
Sensor Network Localization
Recover a network's geometry from noisy pairwise distances (MDS / gradient descent), with Monte-Carlo uncertainty and a rigidity phase transition.

Demos & experiments

Triangle splats
Triangle splats
The triangle cousin of 3DGS, in WebGPU.
Bounding Volume Hierarchy
Bounding Volume Hierarchy
Pre-sort a mesh's triangles nicely and get a BVH at zero memory cost.
Ising model
Ising model
3D cubic Ising spins via WebGPU compute — Metropolis Monte-Carlo at interactive framerate.
Curly thing
Curly thing
Dynamic tessellation in a compute pass — demomaker-ish WebGPU fun.
Stippling toy
Stippling toy
LBG / Lloyd algorithm in live action, with lots of knobs to play with.
Difference of Gaussian
Difference of Gaussian
Play with all the DoG parameters, in WebGL.
Tree roots
Tree roots
The root of a tree isn't that special — pick any node as the root.
Thinning
Thinning
Two algorithms that extract skeletons from binarized images.
QR code generator
QR code generator
Embed pictures inside QR codes.
CVM algorithm
CVM algorithm
Animated online estimate of the number of distinct elements in a stream.
Triangle compression
Triangle compression
Triangulation + colormap → a tiny base64 image preview (ICIP 2018).
Triangle encoder
Triangle encoder
The pure-JS optimizer behind it — paste its base64 output into the decoder.
Welzl's algorithm
Welzl's algorithm
Convex hull + smallest enclosing circle (2D). The interest is the code.
Kruskal's algorithm
Kruskal's algorithm
A simple, elegant Minimum-Spanning-Tree extraction from a point set.
Particle Life
Particle Life
Randomly interacting particles — hit Random exploration for fun.

Shaders & tools

Minishader converts simple ShaderToy code into a standalone HTML + WebGL page. A few shaders made along the way:

Minishader
Minishader
ShaderToy code → standalone HTML + WebGL page.