Skip to main content
danangell.com/blog about

The Joy of Writing Shaders

Shaders provide programmers with a beautiful combination of art and math. Most other throwaway projects are devoid of any artistic value. In less than a dozen lines of code you can draw fractals. A few more and you can start creating intricate animations. The most interesting part is the unique perspective they force you into. Say you want to draw a circle in an imperative programming language. You need to break out a for loop and calculate the sin and cos of different angles until you have points all around the circumference of a circle.

Advent of Code 2017

The intention is to force myself to get a small taste of a bunch of new programming languages and programming paradigms. Since I was late to the party I rushed through the first 4 problems in languages I’m familiar with. But for day 5 I solved the daily problem with MIPS assembly. I look forward to learning and writing Common Lisp, Haskell, Prolog, and many more languages. One hope I have is to complete a problem in GLSL.

The N Sphere

It’s very common for high-school students to learn the geometry of a circle.
Trigonometric functions (sin(), cos(), etc.) are required knowledge for
high-school graduates, and they have a close relationship to circles. This means
that most students have seen the equation for a unit circle:

The Basics of Anti-Aliasing

How images are rendered Imagine your computer is rendering an image of a tomato on top of a table. In order to render the image each of the 1920 * 1080 pixels on your screen needs to have colors assigned to them. This isn’t as easy as viewing a video or an image. The tomato can be viewed from any angle, and the pixels will need to be recalculated many times every second to produce a smooth animation.