My Silly IsEven Function

Recently, this tweet by Kat Maddox aka @ctrlshifti has been making the rounds on Twitter. The replies quickly turned into a competition to write the most cursed IsEven function possible. I decided to join in on the fun and after some experimentation, I came up with the following function written in C. int is_even(int n) { while (n >> 1) n *= n; return !n; } At first glance, this function looks like it wouldn't even terminate for most inputs, let alone return the correct result....

August 2, 2020 · 2 min

Convergence

a 4k exe-gfx entry released at NOVA 2020 [pouët] This was my first proper exe-gfx entry. Up until this point, all of my entries have been real-time, meaning I always had to be careful with using system resources to ensure the entry runs at 60 fps in 1080p. So I decided I wanted to do something with tons of lines, rendered across multiple frames because I could. The system I came up with initially would use one framebuffer to store the start and end position for millions of lines in the XY and ZW components of each pixel respectively, and a second shader would go through and render these onto the screen....

June 21, 2020 · 2 min

Every Color Once

This image contains every 18-bit color exactly once I've been reminded of this age-old stack overflow coding challenge the other day and wanted to figure out how one could use fragment shaders to transform any input image into an image that uses every $n$-bit color exactly once. The approach I took was to map every pixel from the input image into a ${(2^n)}^3$-cube, sort the pixels inside the cube by their RGB value respectively, and replace every pixel in the image by the final coordinate of the corresponding pixel inside the cube....

May 24, 2020 · 1 min

Wackelkontakt

a 4k PC intro released at Revision 2020 [pouët] First of all, I want to thank noby for their amazing work with the intro. Not only are they responsible for the entire soundtrack and gave the visuals a final touch, but they also provided the 4k intro framework Leviathan-2.0, which this intro is based on. As a disclaimer, this write-up will be written from my perspective, and I will hence not spend too much time talking about the music or how the framework as linked above works....

April 12, 2020 · 6 min

Glitch Rider

a 4k PC intro released at Evoke 2019 [pouët] This entry is a demonstration of how to fake the data moshing effect using fragment shaders in 4kb. It is the spiritual successor to Kill the Encoder, which was my last 4k intro at the time. Data Moshing Many video codecs use inter-frame compression. The idea is that a frame in a video typically looks similar to the frames immediately before and after it, so most of the time, you can get away with storing only what changed between frames rather than storing all the frames individually....

August 19, 2019 · 4 min

sler.py

The following exchange took place on March 18, 2019 in a conversation about domain hacks on discord: slerpy I just realized if I do that with my handle, it looks a python script yx :D yx write a demo in python yx I want to see the beamslide for sler.py by slerpy Yeah, so that's how that happened. The Entry This is the 4k exe-gfx entry sler.py by slerpy, which renders a picture of slerpy....

August 18, 2019 · 5 min

Think Outside the Box

a 4k PC intro released at Under Construction 2018 [pouët] In this intro, I wanted to play around with real-time graphics using baked, path-traced lighting. I am aware that baked lighting is quite popular in oldschool demos, but as far as I know, this is the first 4k PC intro to implement it. The Lightmap The lighting information for all four rooms is stored in one flat texture, that is rendered at the start of the intro....

December 28, 2018 · 2 min