Skip to content

ljaaskela/driven_by

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

driven by pressure

A 4k intro for Windows, 4090 bytes binary.

screenshot

The demo runs in infinite loop. ESC quits.

Watch it

https://www.youtube.com/watch?v=YlNNRSc7A7U

How it fits in 4k

  • Text is rendered analytically from quadratic bezier outlines in the fragment shader, adapted from velk-platform's text plugin, real vector Orbitron at any size and animation with no need for font textures. bake_font.py quantizes the TTF's glyf outlines to a 40-units-per-em grid at build time and emits them as byte-packed curve strips; main.c expands them into plain vec4 uniforms at startup
  • Only the 20 glyphs the texts actually use are baked; every text screen is at most 16 characters, re-uploaded per frame from a beat-driven schedule
  • One fullscreen fragment shader does everything else: a raymarched apollonian sphere packing (5 sphere inversions, scale parameter breathing with the music), the kick-synced flashes, and all the glyph animation
  • Music is synthesized into a buffer at startup and looped via waveOut: integer phase accumulators, parabolic sine, LCG noise, Chamberlin SVFs, an Am-F-C-G progression with a fuzz-clipped legato lead through a dotted-8th delay.
  • The intro clock is waveOutGetPosition, so every visual event is sample-locked to the music
  • Compiled x86 with MSVC, linked and compressed with Crinkler

Building

Run build.bat. It needs:

  • Visual Studio 2022 (the build must be x86 — Crinkler outputs 32-bit PEs)
  • Crinkler 2.3

The baked font and minified shader headers are committed under generated/, so that's enough to build the exe. Only if you change shader.frag or the texts do you also need:

See build.bat for the expected paths; it regenerates the headers when those tools are present and otherwise uses the committed ones, then compiles main.c without the CRT and Crinkler-links the compressed intro.exe, printing the byte count.

About

A 4KB intro with quadratic bezier text rendering

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors