
Source code for 4kb demoscene production “Elevated” released - jsheard
https://files.scene.org/view/resources/code/sources/rgba_tbc_elevated_source.zip
======
jsheard
Release info:
[http://www.pouet.net/prod.php?which=52938](http://www.pouet.net/prod.php?which=52938)

Binary:
[https://files.scene.org/view/parties/2009/breakpoint09/in4k/...](https://files.scene.org/view/parties/2009/breakpoint09/in4k/rgba_tbc_elevated_2016.zip)

Video:
[https://www.youtube.com/watch?v=jB0vBmiTr6o](https://www.youtube.com/watch?v=jB0vBmiTr6o)

Everything you see and hear is procedurally generated by the 4096 byte
executable, in real time. It still blows my mind 7 years after release...

~~~
Thaxll
4KB using directx/opengl, very different from old time writing stuff directly
in the video card.

~~~
ekianjo
Exactly, 4kb on top of the hundreds of megabytes of libraries and drivers.

~~~
reitanqild
Somehow you make it sound easy or even belittling it.

I'd say this is quite an achievement anyway when I know I'd use more space
than that just to store a single jpeg or mp3 sample.

~~~
andrepd
I think what parent was trying to say is that it's absolutely an achievement
relative to storing a jpeg or mp3 sample, perhaps not so impressive next to
the old 4k intros.

------
tbabb
For anyone interested/thinks this stuff is cool, the author of Elevated has
made a website for experimenting with real time pixel shaders in WebGL:
[https://www.shadertoy.com/](https://www.shadertoy.com/)

Some pretty incredible things have been done there.

~~~
kentf
A friend of mine also has this project,
[http://shaderfrog.com/](http://shaderfrog.com/)

Let's you experiment with and compose different shaders.

~~~
sdwisely
This is brilliant, I use shadertoy a bit to quickly test out where I've gone
wrong in my fragment shaders (which is usually the whole thing).

This actually seems like it'll be much better for the job.

I'd love to see ISF export added too:
[https://www.interactiveshaderformat.com/spec](https://www.interactiveshaderformat.com/spec)

------
Malic
After viewing LFT's work in using an ATMEL microcontroller as a demoscene
platform:
[http://www.linusakesson.net/scene/craft/index.php](http://www.linusakesson.net/scene/craft/index.php)

...I had the thought a possible frontier in demoscene is make your own
hardware out of discrete components to run your demo.

The MOnSter 6502 would count -
[http://monster6502.com/](http://monster6502.com/)

~~~
duskwuff
Just because that wasn't enough, lft has _also_ written a demo which created a
custom CPU/GPU on an FPGA to run a demo:

[http://www.linusakesson.net/scene/parallelogram/](http://www.linusakesson.net/scene/parallelogram/)

------
psuter
Most programming jobs must feel terribly boring for anyone who managed to
write that.

~~~
corysama
Here's what he's been up to lately:
[http://mygtc.gputechconf.com/quicklink/esLu6kr](http://mygtc.gputechconf.com/quicklink/esLu6kr)

~~~
yxlx
Will an online recording be available of that talk? I'd love to watch it.

~~~
corysama
Officially, I think the videos from GTC2016 are behind a free registration
wall. You can register here:
[https://mygtc.gputechconf.com/form/account](https://mygtc.gputechconf.com/form/account)

Unofficially, you can find this particular talk here: [http://on-
demand.gputechconf.com/gtc/2016/video/S6860.html](http://on-
demand.gputechconf.com/gtc/2016/video/S6860.html)

~~~
yxlx
Sweet, thanks!

------
pkrefta
In year 2000 when I was 16 years old 64k fr-08 by farbrausch told me that I
know nothing about programming ;)

[1]
[https://www.youtube.com/watch?v=Y3n3c_8Nn2Y](https://www.youtube.com/watch?v=Y3n3c_8Nn2Y)

~~~
davrosthedalek
Indeed, and for me, before that, Future Crew's Second Reality.

~~~
Keyframe
Second Reality was the best. First demo that I saw was Spaceballs' State of
the art
[https://www.youtube.com/watch?v=c5kuYfTCGLg](https://www.youtube.com/watch?v=c5kuYfTCGLg)
and I vividly remember of thinking 'wtf is that, a video or what?' and then
Second Reality a year later or so -
[https://www.youtube.com/watch?v=rFv7mHTf0nA](https://www.youtube.com/watch?v=rFv7mHTf0nA)
But then (I look all and every demo out there by then at the age of 13) I saw
Mars demo
[https://www.youtube.com/watch?v=_zSjpIyMt0k](https://www.youtube.com/watch?v=_zSjpIyMt0k)
which hooked me forever on the path of graphics programming.

~~~
davrosthedalek
Oh yes! I remember Mars! At some point, the was a text floating around the net
which described how it worked, that was mind-boggling for the 14 year old me.

------
sclangdon
Although they generally didn't compete in the 4kb genre, Farbrausch open-
sourced many of their demos and demo-making tools a few years ago [1].

fr-041: Debris [2], and kkrieger [3] (the 96kb FPS) are particularly worth
checking out for the uninitiated.

[1]
[https://github.com/farbrausch/fr_public](https://github.com/farbrausch/fr_public)

[2] [https://youtu.be/wqu_IpkOYBg](https://youtu.be/wqu_IpkOYBg)

[3] [https://youtu.be/2NBG-sKFaB0](https://youtu.be/2NBG-sKFaB0)

------
joaorj
Does this mean that lots of 3:30 minutes 1080p videos could be compressed into
4kb?

EDIT: We can be generous and say 40kb for sake of adding more colours / etc.

~~~
tikhonj
This is actually an insightful question.

The practical answer is _no_. There is an unimaginable amount of possible 3:30
minute vidoes—far more than the number of possible 4kb or even 40kb files.

To be fair, most of those possible vidoes are just noise. We don't have to be
able to compress those because people don't care if one video of noise is
different from another. We also don't have to reconstruct the video
_perfectly_ : as long as it looks more or less the same, the audience is
happy. (This is called "lossy compression".)

But even with these caveats, there is no realistic method for compressing
realistic 3:30 minute videos that well on a computer. We likely can't do all
_that much_ more than current compression algorithms without a different set
of tradeoffs. (Like being better at some videos but worse at others.)

That said, a big part of how compression works is by relying on information
already present when decompressing. This demo relies on having a particular
kind of chip with certain capabilities (ie a CPU and a GPU) and presumably
some standard library functions... etc.

How well could we "compress" videos if we had more information available when
decompressing? Here's a fun thought experiment: what if we had _a model of a
human mind_? We could then feed in a pretty sparse description and have the
model fill in the details in a natural intuitive way. It would be _very_
lossy, but the results would be compelling.

And you know what? That's a decent mental model of how speech works! If you
just look at information content, spoken words are not very dense. But if I
describe a scene you can imagine it almost as if you're seeing a video. This
works because we both have the same sort of brain as well as shared
experiences and intentions.

You can think of speech as incredibly effective—but also rather
lossy—compression.

~~~
jameshart
4K of English text is a couple of pages of a novel, enough to describe a
character and a situation, maybe an interaction. A good writer can conjure up
a whole world in 4K... but probably not a description of an arbitrary 3 and a
half minutes of activity.

~~~
joaorj
That being said, speech is far from the best compression we can ever hope of
achieving.

------
dharma1
classic 4k, beautiful stuff. here's another one of my favourites from 5 years
ago:

zeo-x-s/cdak

[https://vimeo.com/25284552](https://vimeo.com/25284552)

[http://prostheticknowledge.tumblr.com/post/73734927255/cdak-...](http://prostheticknowledge.tumblr.com/post/73734927255/cdak-
by-quite-orange-demo-written-in-4k-and)

Beautiful soundtrack from Lassi Nikko (tpolm/orange) and crazy cool
raymarching shader work from unc (quite)

shadertoy version with VR support:

[https://www.shadertoy.com/view/MdyGzD](https://www.shadertoy.com/view/MdyGzD)

------
joshstrange
I know a RasPi doesn't have near the specs needed to run this but I'd love to
gut an old flat screen monitor and put it in a frame with a RasPi running
something like this, generating random "art" and hang it on a wall
somewhere...

~~~
schwarrrtz
you mean like this?
[https://www.electricobjects.com/](https://www.electricobjects.com/)

~~~
joshstrange
That's awesome! Thank you for that link, a little pricy but the screen would
be nicer than what I have laying around and it's more plug-and-play,
bookmarked!

------
leeoniya
also impressive:
[https://en.wikipedia.org/wiki/.kkrieger](https://en.wikipedia.org/wiki/.kkrieger)

~~~
jsheard
Conspiracies 64kb demo from earlier this year is fantastic too.

[http://www.pouet.net/prod.php?which=67106](http://www.pouet.net/prod.php?which=67106)
/
[https://www.youtube.com/watch?v=qRVTI2y0BBg](https://www.youtube.com/watch?v=qRVTI2y0BBg)

~~~
hansjorg
Awesome stuff, yet it was only voted 2nd in the competition (Revision 2016
64kb compo). Here's the winner (fermi paradox by mercury):

[https://www.youtube.com/watch?v=JZ6ZzJeWgpY](https://www.youtube.com/watch?v=JZ6ZzJeWgpY)

The scenes with the moon being peppered with impacts (3:31) and what appears
to be storms on Jupiter are beautiful.

~~~
Mithaldu
As someone who was there: Darkness was impressive for sure, but not all that
fun to watch, since it was mostly static dioramas, which the viewer can grok
in a few seconds, and then it goes "oh and each one has a little jiggle too".
Camera movement is minimal, and even when its there it doesn't expose anything
new in the scene to the viewer. Additionally every scene is mostly faked with
very obvious 2D shapes, meaning if the camera moved too much, the illusion
would break. Lastly, the music was quite dull and not connected with what was
on screen.

Fermi Paradox was also dioramas, but: Each one had had some engaging event
happening, or at least well directed camera movements that exposed new visuals
to the viewer over time or show-cased the full 3d nature of each scene.
Additionally each scene had at least one well done graphics effect. The music
was almost movie quality and in a few parts nicely synched up with the
visuals.

------
djvdorp
If people wonder why I'm so obsessed with computers, this is the reason.

------
shurcooL
This was one of my favorite demos back in the day. I still have a copy of it
(along with 10~ other favorites) sitting in a "Demoscene" folder somewhere.
Many of them don't work on today's hardware/software, sadly (including this
one).

It's great that it's open source now! That means if someone's really
motivated, they can update it to run on modern environments (by no longer
keeping it 4 KB), even OS X, etc.

------
ekr
And I had been planning to reverse engineer it for some time, but never got
around to doing it.

Hats off to Inigo and others.

------
collinmanderson
Am I the only one who's reminded of the Excel 97 easter egg?

------
polard2
Here's their release of how they made it as well. Super interesting read. It's
shaders all the way down.

[http://www.iquilezles.org/www/material/function2009/function...](http://www.iquilezles.org/www/material/function2009/function2009.pdf)

~~~
passthefist
Ha, that's my exact comment from the related reddit thread. Kinda cool, I
wonder how often that happens?

[https://www.reddit.com/r/programming/comments/4msf41/elevate...](https://www.reddit.com/r/programming/comments/4msf41/elevated_the_winning_4k_from_breakpoint_2009_is/d3y5g9x)

~~~
toxik
You do realize he copied your comment, don't you?

~~~
DanBC
That's been happening a bit recently.

[https://news.ycombinator.com/item?id=11837687](https://news.ycombinator.com/item?id=11837687)

(I think there are others, but I can't find them now.)

~~~
relaytheurgency
Both usernames end in 2

------
zump
Can someone TLDR how this stuff works?! I NEED TO DO IT!

------
nickpsecurity
That's unreal. On what kind of graphics hardware, though? Seems like it
probably offloads most of the work on GPU whereas we'd have had to do most of
it in software on HW weak enough that 4KB size actually mattered. And probably
not achieve this demo.

~~~
adamnemecek
The 4kb restriction isn't there to make it run on weak hw, it's there to push
people.

~~~
imtringued
However it does irritate me that it's pregenerating the entire scene in
memory. Being allowed to use 300MB of RAM doesn't strike me as very limiting.

~~~
wolfd
You wanted optimized code size and optimized performance?

I mean, sure, but think about how big 4KB is, the tricks that are being used
to create the scenes are crazy hacks using default Windows sound files and
literally anything the executable can reference on the cheap.

Procedural content generation is _really_ expensive (in general), but that's
the beauty of it. You find a way to abstract the content into an algorithm,
and then you can reduce the size of the assets, but you pretty much always
need to pay the price somewhere.

But hey, I understand the sentiment, I wish Slack didn't consume 2 GB of RAM
on my machine.

------
wicket
This is actually 4KB (kilobytes). The title lead me to believe it was 4Kb
(kilobits). Still impressive though.

------
kyled
Back in the day demos were more impressive imo. A lot of them now use direct x
or opengl. For the most part the stuff you see isn't written by hand anymore
AFAIK, they just have programs to generate the actual demo. Basically they use
modeling programs.

~~~
csl
While true for large demos, the 4kb — perhaps even 64kb? — are still written
very much by hand.

~~~
kyled
I hope so. I'm not involved with the scene at all, but I did read a bunch of
history about the scene and watched tons of demos.

I think farbrausch was one of the major groups who did this sort of thing
[https://github.com/farbrausch/fr_public](https://github.com/farbrausch/fr_public)

------
cyphar
Cool idea, too bad it's not free software. It's less free than any software
I've seen (explicitly saying that you can't use it for "settings where
security is critical" \-- something that doesn't even make sense from a
software license perspective). It's like the "Good not Evil" line in the JSON
license.

~~~
astrange
Check out how many of your commercial software licenses forbid running them in
nuclear power plants.

~~~
cyphar
I use free software, so none. :D

~~~
hcs
Alternately, all of them :P

