Introduction

In the demoscene, where every byte counts as a creative decision, producing a 4K intro remains one of the most demanding disciplines in real-time computer art. A complete executable—visuals, audio, camera choreography, and timing—must fit inside 4096 bytes while running smoothly at 60 fps on modern GPUs. By 2026 the community continues to push boundaries with releases at Revision, Assembly, and Demobit that rival commercial productions yet weigh less than a single PNG thumbnail.

The challenge combines extreme size optimization, procedural generation, executable compression with tools such as kkrunchy and Crinkler, GLSL code golf, and sample-free audio synthesis. These techniques emerged from the early 2000s when groups like RGBA and Fairlight demonstrated that 4 KB could contain ray-marched landscapes and chiptune-like music. Today the same principles apply, now augmented by shadertoy-era knowledge and modern compression research. This guide examines each layer of the pipeline, from initial math formulation to final packing, providing concrete examples used in 2025–2026 productions.

4096 bytes counter display creating complex 3D landscape in amber glow

The Evolution of 4K Constraints Since 2000

The 4K category crystallized around 2003 when the 64K limit began to feel generous. Early pioneers relied on 16-bit x86 assembly and tiny software renderers. By 2008, Crinkler 1.0 introduced its hash-based import reconstruction and context-modeling compressor, instantly dropping average sizes from 3.8 KB to 2.1 KB for comparable effects. kkrunchy, developed by Mr. Pet, took a different route with LZMA-derived front-end filtering and became the default choice for OpenGL intros targeting Windows XP–7 compatibility.

Between 2015 and 2020, the rise of GLSL 3.30+ allowed entire scenes to move into fragment shaders, freeing the executable from vertex data. Productions such as “Elevated” successors at Revision 2024 demonstrated 3.9 KB ray-marched scenes with dynamic lighting. In 2026 the scene still observes the original 4096-byte hard limit, yet leverages AVX2 and compute shaders through careful import table construction. Historical data from pouët.net shows roughly 140 new 4K intros released yearly, with compression ratios averaging 7.8:1 after Crinkler 2.1a preprocessing.

Procedural Generation of Visual Content

The visual core of every 4K intro is a handful of GLSL shaders that make 4K intros possible — usually a single raymarched fragment shader.

Procedural generation replaces stored geometry and textures with mathematical functions evaluated at runtime. A typical 2026 4K intro begins with a distance-estimator for ray marching written in under 400 bytes. One common pattern uses a single 3D noise function based on iq’s hash:

float hash(vec3 p){p=fract(p*0.3183099+0.1);p*=17.0;return fract(p.x*p.y*p.z*(p.x+p.y+p.z));}

This hash seeds fractal Brownian motion for terrain or clouds. Camera paths are encoded as short polynomial splines; coefficients are stored in a 64-byte constant array and evaluated with Horner’s method. To animate objects without keyframe data, productions reuse the system time variable t as a phase input to sinusoidal oscillators. For example, a rotating torus knot can be described with only eight floating-point literals plus the time uniform.

Texture synthesis often relies on value noise layered three octaves deep, eliminating any need for embedded bitmap resources. Color palettes are generated from cosine gradients (iq’s formula) using six coefficients total. These methods allow a complete cityscape fly-through to occupy fewer than 700 bytes of shader source before minification.

Executable Compression with kkrunchy and Crinkler

After the final binary is assembled, two specialized tools dominate the final size reduction step. Crinkler 2.1a (released 2023) performs import hashing, context mixing, and call-transformer optimizations. Typical usage on a 12 KB intermediate PE file yields:

crinkler.exe /COMPRESSALL /HASHTRIES:300 /ORDERTRIES:2000 /UNSAFEIMPORTS intro.obj opengl32.lib

The resulting executable often lands between 2.8 KB and 3.4 KB. kkrunchy 0.23a, preferred for broader Windows compatibility, applies a different pipeline of LZMA with a custom 4 KB dictionary and relocation stripping. Authors frequently run both compressors and select the smaller output, sometimes shaving an additional 120 bytes.

Entering the size category requires understanding the 4K competition format and how it is judged at each major party.

Header reduction techniques include merging the DOS stub, collapsing the data directory, and forcing section alignment to 1 byte where the loader permits. In 2026, several groups also employ post-Crinkler delta encoding on constant tables, gaining another 40–70 bytes on average.

GLSL Code Golf and Shader Minification

GLSL code golf focuses on reducing character count while preserving identical GPU behavior. Common tactics include single-letter identifiers, reuse of the vec4 swizzle space, and macro-based function inlining. A 2025 winning entry at Assembly compressed a full ray marcher into 478 characters by exploiting the fact that dot and length can be interchanged with algebraic identities.

Minification passes often employ custom Python scripts that rename variables according to frequency and remove unnecessary parentheses using operator precedence tables. The shader is then embedded as a C-string literal inside the executable. Because Crinkler models the entire binary, even small textual changes in the shader source can affect final compressed size; therefore authors iterate compression after every golfing round. Recent productions also exploit GLSL 4.60’s ability to omit certain qualifiers, dropping another 15–25 characters per shader.

Sample-Free Audio Synthesis Techniques

Music occupies the most stubborn bytes when samples are involved. Modern 4K intros therefore generate all audio procedurally. A typical pipeline uses a single oscillator bank performing frequency modulation inside a 512-sample ring buffer. The synthesis engine fits in roughly 300 bytes of x86 code and exposes eight parameters: carrier frequency, modulator ratio, two ADSR coefficients, filter cutoff, resonance, delay time, and feedback.

Hardware matters even at 4 kilobytes — ComputerHeaven’s GPU specs that affect 4K intro rendering explains which GPU features the best intros depend on.

Melodic content is produced by a deterministic pseudo-random walk over a major scale, seeded from the current frame number. Percussion emerges from short noise bursts filtered by a one-pole low-pass whose cutoff follows an exponential decay envelope. Because the audio callback must be tiny, most intros reuse the same 80-byte routine for both music and sound effects, simply changing the parameter vector each measure. The result is a soundtrack that evolves coherently for the full 60-second duration without any stored PCM data.

Crinkler compression tool terminal showing 4K intro packed to exact byte count

Practical Tips / Getting Started

Begin by installing the latest MASM or NASM toolchain together with Crinkler 2.1a and kkrunchy 0.23a. Create a minimal OpenGL 3.3 bootstrap that opens a window and compiles a placeholder fragment shader. Measure the uncompressed size after each added feature. Target a 9–11 KB intermediate file before compression; anything larger rarely packs below 4 KB. Maintain two shader versions—one human-readable, one minified—and switch between them via a build flag. Profile GPU frame time early; 4K intros often run close to the 16 ms budget once ray-marching step counts exceed 60. Finally, test on three different Windows versions and two GPU vendors before final submission, as import reconstruction failures remain the leading cause of 2026 party rejections.

FAQ

The rendering tricks used inside these tiny executables are the same real-time rendering techniques found in production engines — just extremely compressed.

How small can a musically complete 4K intro realistically become in 2026?
Current record holders sit at 3.4 KB with 48-second tracks. Further gains require trading melodic complexity for additional visual detail; the absolute lower bound appears to hover near 2.9 KB given present compressor technology.

Which compressor should I choose, Crinkler or kkrunchy?
Crinkler 2.1a usually wins on size for pure OpenGL intros, but kkrunchy 0.23a produces binaries that run on a wider range of legacy systems and corporate images. Always compress with both and compare.

Can I use modern GLSL extensions such as compute shaders?
Yes, provided the import table remains under 60 bytes. Several 2025 releases successfully invoked glDispatchCompute after careful ordinal hashing.

How do I synchronize audio and visuals without a beat-detection library?
Reuse the global frame counter as a shared timeline. Calculate measure boundaries mathematically (e.g., if(fract(t/4.0)<0.01)) and trigger both visual camera cuts and musical phrase changes from the same expression.

What is the recommended starting template in 2026?
The “4K-Template-2026” repository on GitHub provides a 1.2 KB stub including window creation, shader compilation, and a minimal FM synth. It compresses to 2.7 KB with Crinkler defaults, leaving roughly 1.3 KB for your own effects.