Skip to content


Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

BEPCT4K: A pure assembly framework for making 4k intros

Very simple framework for making generic 4klang + fullscreen fragment shader 4k intros. Written in pure assembly and does not require Visual Studio installed. Just add and shader.frag files and run build-slow.bat to build a release binary of your intro.

How to use

Make music

  1. Make music in 4klang
  2. Export it into, replacing existing file here

Make visuals

  1. Make a full screen GLSL fragment shader somewhere, e.g. in Shadertoy or Bonzomatic
    • We plan to provide a more convenient tool for editing shader in sync with music, see issue #4
  2. Copy shader source to shader.frag file
  3. "Port" shader from your tool, e.g. (it may require more editing):
    • This tool will create OpenGL 2.1 context, so GL is limited to #version 130
    • add uniform float t;, this is the uniform that will get current time in BPM-dependent music ticks, not seconds.
    • make void main() and gl_FragColor and gl_FragCoord instead of whatever your tools have
    • replace Shadertoy's:
      • iTime with t
      • fResolution with vec2(1920., 1080.)
    • Bonzomatic's:
      • fGlobalTime with t


  1. Run build-fast.bat to build intro-fast.exe

Usage recommendations

Use build-debug.bat when first porting your shader. It will build a debug configuration that won't have music, will be windowed, will check all gl calls and MessageBox in your face about shader compilation errors.

Use build-fast.bat when iterating and estimating intro size. It will build your intro in seconds.

Use build-slow.bat when crunching for final. It will be 50-100 bytes less than fast variant, but will take several minutes to build.

How it works

  1. Shader Minifier is ran against shader.frag file to generate with minified shader file.
  2. NASM compiles intro.asm into intro.obj; it includes and for metadata.
  3. NASM compiles 4klang.asm into 4klang.obj; in includes for music data.
  4. Crinkler links and compresses these object files into a final binary.

If you understand Russian, you can watch a somewhat more in-depth explanation here:


This framework uses:

Kudos to all these projects authors! Without them modern size-coding scene would not be the same!

All these dependencies are downloaded automatically whenever you run any of the build scripts for the first time.


WTFPL for this repo itself (or Public Domain if you're boring).

Dependencies have their own respective licenses, consult them.


4k intro framework in pure assembly. No Visual Studio required!






No releases published


No packages published