Condition: A 64KB WebGL Intro
github.com
github.com
For the context, this intro got third place at Revision PC 64k competition.
Revision is the largest "pure" demoparty, and its competitions are of the highest level, especially this year. The PC 64k category is one of the most demanding, as nowadays, you are expected to make a full demo, with good sounding music, direction, multiple scenes, etc... but with the 64k constraint, which, in practice, means that everything has to be procedurally generated.
And FMS_Cat did all that by himself! Code, graphics and music. He also manages to stay humble about it. Big thumbs up.
Basically, you'll need to learn to write shader code if you want to replicate this. A good place for beginners to start is The Book of Shaders[0]. It doesn't mention raymarching specifically, but it will give you the building blocks to understand it later.
Once you have a basic understanding of shaders, check out the site of Inigo Quilez[1] to learn more about raymarching and distance fields.
[0]: https://thebookofshaders.com/ [1]: https://www.iquilezles.org/www/index.htm
Today's 64k intros offload their drawing onto the GPU using shaders and a technique called raymarching which is a form of fixed-step raytracing that can be done in real time. Essentially the objects you see are painted with math: instead of thousands of vertices for a 3d fractal or a complex object, a formula is fed in to the ray marcher and it returns a shape with colors and lighting. Combining shapes using unions and intersections is then done and often the shape formula will take time as a parameter as well. To play with this concept yourself go to https://www.shadertoy.com/browse and see how shader programs are rendered into incredible scenes with astonishingly few lines of code.
For a wonderful look at the creation process, see the grandfather of raymarching Inigo Quilez create a selfie of a girl from scratch using formulas here: https://www.youtube.com/watch?v=8--5LwHRhjk
One can then generate the instructions to the 3D rendering engine and the highly custom software synthesizer in the player. This information easily fits in (less than) 64 KB. The achievement is not in the final result, but in writing the demomaker.
The German group Farbrausch (former Sanity on the Commodore Amiga) was the first to invent this procedural generation technique. Almost two decades ago, they wrote their own demomaker called .werkzeug (.tool).
Source: Wrote a tool in 1998 for our not-great-looking 64k intro "Pure" by demogroup Quad.
In "full size" demos there are often many exceptions to that: Non-procedural assets (some exported from other software) like soundtrack, models, textures, animation and so on, which really expands the possibilities, it's really just the tiny size categories that squeezes them out (maybe also that compression ends up slightly less interesting/useful than creative reconstruction?). There's also strong respects paid for achieving something that previously required a large blob of data, using a tiny amount of code, like all the cool voice synth stuff that was used to add lyrics to 64kb intros years ago (eg: Candytron by Farbrausch that was released at Breakpoint in 2003!).
Me neither. I just see this: https://i.imgur.com/qzP0Qwb.png
Leave the page open for a minute or so, and it will advance. It did the same for me.
The music is done with a shader, which is in itself insane. https://github.com/FMS-Cat/condition/blob/dev/src/music/musi...
https://www.musictech.net/guides/essential-guide/how-fm-synt...
https://github.com/askeksa/Cinter
Going into more modern examples,
https://docs.microsoft.com/en-us/windows/win32/xaudio2/xaudi...
"Realtime GPU Audio" - https://queue.acm.org/detail.cfm?id=2484010
Because WebGL doesn't expose compute shaders, one is stuck misusing the vertex shader for the same purpose.
I don't really see any advantage/disadvantage to doing music with a shader Vs CPU.
No modern CPU would struggle with the computation for this code, and nor would a GPU. It seems it's just a matter of the programmer being more familiar with the world of graphics.
The demo More by mfx was also in Javascript I believe and was also quite incredible.
https://www.pouet.net/prod.php?which=88631
For people interested, check out https://www.pouet.net/party.php?which=1550&when=2021 for the list of entries and results and https://www.youtube.com/c/RevisionCaptures/videos for video captures of all the entries. Some incredible stuff, including a GPU powered synth.
On this ThinkPad P15 G1 workstation, it took about 2 minutes on Firefox and makes the browser unresponsive to anything other than the click me text.
Not at all comparable.
But the dev build at https://fms-cat.com/condition/pages/condition_640x360_dev.ht... works.
glcat.module.js:1109 Uncaught Error: GLCat.getExtension: The extension "EXT_disjoint_timer_query_webgl2" is not supported at GLCat.getExtension (glcat.module.js:1110) at new GPUTimer (GPUTimer.ts:17) at new Component (Component.ts:115) at new Quad
https://fms-cat.com/condition/pages/condition_1920x1080_fina...
from what I _can_ see it looks cool. I used to love demos in the old days on my 386 with gravis ultrasound :)
This was clearly inspired by Gantz Graf by Autechre:
My guess is that's not the only place Safari falls short for this demo. You also need WebGL2 which Apple has only shipped behind a flag this year. Firefox and Google shipped without a flag 4 years ago
See:
https://i.pinimg.com/originals/6a/09/f4/6a09f4c78c82187da893...