In this post I’m going to show how you turn a truth table into a digital logic circuit that uses XOR and AND gates. My Usage Case My specific usage case for this is in my investigations into homomorphic encryption, … Continue reading

# Category Archives: Computer Science

Wang tiles were invented by Hao Wang in 1961 for mathematical reasons, but they find great use in games for making tile based art which gives results that don’t look tiled – both with 2d tiled textures, as well as … Continue reading

Bezier curves are most often talked about either in terms of the De Casteljau algorithm, or in terms of a mathematical function (Bernstein Polynomials). Every now and then though, you see people talking about Bezier curves being calculated via matrices. … Continue reading

This post is an addendum to the last post where I say that you can make distance field textures with JFA but don’t fully explain how to make SIGNED distance field textures, which is what you really want. If you … Continue reading

The image below is called a Voronoi diagram. The circles show you the location of the seeds and the color of each pixel represents the closest seed to that pixel. The value of this diagram is that at any point … Continue reading

Below is a paper I submitted to jcgt.org that unfortunately did not get accepted. Maybe next time! The main idea of this paper is that bilinear interpolation can be equivalent to the De Casteljau algorithm, which means that if you … Continue reading

The other day I had a thought: Rendering smaller than full screen images is super helpful for performance, but upsizing an image results in pretty bad quality vs a full resolution render. What if instead of upsizing the final rendered … Continue reading

Karnaugh maps are a formalized way of turning a truth table into a fairly minimal logical expression. It’s fairly minimal in that it’s the minimal “sum of products” representation, but that might not be the minimal representation of the logic … Continue reading

While not the most cache friendly operation, binary searching a sorted data set is a pretty good way to search a data set for a specific value because for N items, you have an average case and worst case of … Continue reading

Hash tables are great in that you can hash a key and then use that hash as an index into an array to get the information associated with that key. That is very fast, so long as you use a … Continue reading