Slashdot Mirror


Hacking Hi-Def Graphics and Camerawork Into 4Kb

TRNick writes "The old home-computing art of hacking elaborate graphics and camerawork into tiny amounts of memory has been lost, right? Not so. The demoscene is keeping ingenious coding skills alive, and TechRadar finds out the latest developments. Winner of the 4kb competition at 2009's Breakpoint party was RGBA's demo 'Elevated,' a gorgeous scrolling demo featuring photo realistic landscapes and music, which fits into the memory used by one of your PC's desktop icons. This is really impressive stuff."

6 of 255 comments (clear)

  1. Cheating by Anonymous Coward · · Score: 0, Interesting

    I assume that 4K doesn't include the 3D libraries they used. It's still impressive but 4k of code can create a lot of procedural graphics if you have a few megs of graphics libraries to display it.

  2. Re:I wish by slim · · Score: 4, Interesting

    Try Left 4K Dead

    The fact is that cramming a lot of game into a small space is still worth doing.

    • Flash games sites have bandwidth costs
    • Console gamers develop high expectations as the hardware reaches the end of its lifecycle, and developers compete to squeeze more out of it
  3. Re:Meh by ivoras · · Score: 4, Interesting

    No, it just raises the bar. Back when all you had to work with was CGA in 320x200 it was impressive to show a rotating cube in 4k. Today, this demo nicely shows where the virtual bar is when even considering making a 4k demo. As you couldn't do "Elevated" on your 100 MHz 486 in *no* condition or with any libraries, so would you be laughed at if you presented a rotating cube or a wormhole today.

    Here's an excerpt from TFA:

    for those wondering, this a (too) low density flat mesh displaced with a procedural vertex shader. there arent any texturemaps for texturing, instead texturing (and shading) is defferred and computed procedurally in a full screen quad. this means there is zero overdraw for the quite expensive material at the cost of a single geometry pass. then another second full screen quad computes the motion blur. camera movements are computed by a shader too and not in the cpu, as only the gpu knows the procedural definition of the landscape.

    If you can do better, show your work :)

    --
    -- Sig down
  4. Re:Wow by Anonymous Coward · · Score: 1, Interesting

    Your desktop background is a few KB, but take a video of it in high def, and it will still be a massive file...

    The data contained in the 4K is a music engine, instructions to directX/OpenGL, and custom code. The visual data is a mathematical representation only, and not actual landscape, processed through the renderer and displayed to the screen.

    Your speakers are capable of representing sound in amazing detail from a small amount of data. Your screen and video card extrapolate and do a massive amount of processing (requiring a large memory buffer as well due to the single pass methodology of the rendered used in order to limit the number of instructions required), and the end result is an audio/visual experience in HD that made quite a massive avi file, yes...

  5. Re:Meh by slackito · · Score: 2, Interesting

    Ouch, i thought the formatting would be preserved with tags. Posting as plain old text now :P

    ----- test.c

    const char msg[]="Hello World\n";

    void _start(){
            asm("int $0x80;"::"a"(4),"b"(1),"c"(msg),"d"(12)); // write (1, msg, 12);
            asm("int $0x80;"::"a"(1),"b"(0)); // exit(0);
    }
    ---------
    $ gcc -m32 -Os -nostdlib -nostartfiles -s -o test test.c
    $ wc -c test 436 test
    $ ./test
    Hello World

    And this is just scratching the surface. Of course, in a real 4K you would want to use some compression, too, as pointed by another replies.

  6. Re:I assume the SOURCE fits into 4 kb by fractoid · · Score: 2, Interesting

    I'd presume that there's a fair bit of self-modifying code in there, even if you don't count the almost-mandatory executable packer. Self-modifying code often gives virus scanners a woody. Or the willies, whichever. ;)

    --
    Rampant carbon sequestration destroyed the Dinosaurs' tropical paradise. I'm here to help repair the damage.