RSSAmplifier

Blog

Ryan Kaplan

Software Engineer at Figma. Previously at Dropbox. Studied Math/CS at Brown University.

rykap.comRSS feed ↗8 posts

Latest posts

Ray Marching Soft Shadows in 2D

Disclaimer: the demos on this page use WebGL features that aren’t available on some mobile devices. A couple of weeks ago I tweeted a video of a toy graphics project (below). It’s not done, but a lot of people liked it which was surprising and fun! A few people asked how it works, so that’s what this post is about. Under the hood it uses something called a distance field. A distance field is an…

Building a fast Equation Grapher

I’ve been working on something called Curve Grapher . It’s a webpage that renders graphs of math equations, like $z = sin(p x) cos(p y)$. In the example above, the application realizes that $p$ isn’t a co-ordinate. It shows a slider which lets you change the value of $p$. Doing so updates the graph in real time! This post is a high level overview of how this works. My first attempt at building it…

What the heck is entropy?

I've read many articles online with differing, vague, descriptions of entropy. But I recently found out that it has a clear mathematical representation! Suppose you're performing an experiment which has 5 possible outcomes. We'll label them \(i = {1, ..., 5}\). And suppose that they each occur with probability \(p(i)\). \(p\) is called a distribution, which is just a fancy name for a function that…

Voronoi Diagrams on the GPU

Disclaimer: the demos on this page use WebGL features that aren’t available on many mobile devices. For the best experience, read this on a Desktop computer. What is a Voronoi diagram? Suppose you have a clean, blank canvas. I rudely paint three dots on it: one blue, one red, one purple. Then I ask you to paint the rest of the canvas by painting 1mm by 1mm squares at a time. Before you color each…

Game 'o Life

I found an article by Chris Wellons describing a Game of Life simulation that runs on the GPU and I wanted to try it myself. I wrote my version of it in Skew (which turned out to be a pleasure to use) and it works pretty well. On my laptop it runs fine with grids of 16 million cells. Click here to see a full page demo and here to see the code.

W00T

WOOT stands for ‘without operational transformation’. Operational transformation (OT) is a field of computing commonly used to build real-time collaborative systems like Google Docs. It’s notorious for being complex and difficult to understand, and WOOT proposes to be a much simpler model. The paper is here in case you want to read it. A few years ago I would have dismissed it as a hack (a key to…

More than you want to know about @synchronized

If you’ve done any concurrent programming in Objective-C, then you’ve seen the @synchronized construct. The @synchronized construct does just what a lock does: it prevents different threads from executing the same code at the same time. But it’s more convenient and more readible in some cases compared to allocating, locking and unlocking an NSLock . If you’ve never used @synchronized before, below…

An Intro to OT

I’ve been reading about real-time collaborative editing. One popular approach is OT (operational transformation). Most OT resources online reference this old paper on the Jupiter Collaboration system . It’s one of the first to introduce OT as a technique for building collaborative editors and while it’s easy to read, it’s light on details and spends more time than I’d like describing what…