How a 64k intro is made
lofibucket.com
lofibucket.com
It is also available in English, at: https://www.youtube.com/watch?v=iRkZcTg1JWU
I hope you still find it interesting.
Then at some point, other engineers use those 'underlying principles'/primitives in order you build up particular complex instances of whatever domain was analyzed in the previous stage—but it does start with the science-like analyzing and 'theory building' (not literally—it just has an analogous structure/role).
Note to others: that's 32 BYTES! :)
asm file is included
https://www.youtube.com/watch?v=V8JXraZPkh8&list=PL-sXmdrqqY...
Stepping is done using something called "sphere tracing" - where for each step along the ray, you compute a sphere, and where it intersects the scene, and only step that far; as you get closer to surfaces, the spheres become smaller (and so do the steps and more computations) - this keeps you from sampling along the ray where there is no scene, and stepping along the ray in larger "jumps" to keep the computational reqs down (it has limitations, particularly along edges of objects, and complex scenes).
For 4k comps (and in general, I think) objects of the scene are described algorithmically (ie - you don't create a model of a sphere or torus or cube, but rather the mathematical representation of it) - so intersects with the ray become a bit trivial. At the same time, complex scenes can become tedious to lay out, so you typically see tessellations and repetitions of scene objects, or other mathematical constructs are used (fractals and the like) that can generate complexity from simple representations (thus, procedural rendering and representational concepts come into play of course).
There was a ton more involved (found interesting shadertoy demos from known authors, going over the concepts of how raymarching and related techniques are used - especially in the context of GPU shader rendering, where it is frequently used in 4k compos - the idea of "two triangle demos", doing everything in the shaders) - and I probably got a lot of this wrong or over-simplified (as I said, I felt a lot went over my head in the math arena).
But I think I got the gist. Regardless, it was a fascinating exploration, and taught me some new things I didn't know about until then; I haven't kept up much with the demoscene since I stopped playing around with my Amigas a long time ago (aside from the occasional amazing demo or whatnot here and there - especially those authors who like to push their Craft - hint-hint - using microcontrollers). So it was nice to see what "state of the art" was. Although - milkytracker is still being used as well - which is nice to see.
The other basic components when creating scenes to be raymarched are distance functions which combine other distance functions together. The simplest cases are just union and intersection, but it's easy to get more interesting things like smoothly blending objects together. This page is a nice reference of these 'combining' functions as well as distance functions for geometric primitives: http://mercury.sexy/hg_sdf/ I think that combining power is one of the main reasons to use raymarching/distance functions: building procedural content this way is faaar easier than trying to knit triangle meshes together.
Additionally, if anyone wants to go a little further on the subject of building up sophisticated content by raymarching distance functions, this is an excellent talk on the subject: https://www.youtube.com/watch?v=s8nFqwOho-s
http://www.iquilezles.org/www/articles/distfunctions/distfun...
...written by one of the authors of this amazing 4k (four kilobytes!) demo:
I was still able to run it in an sandboxed environment and it worked fine, and kaspersky didn't chirp, so for an outdated or incompetent AV, you wouldn't even notice.
ESET found malware in the demo file they have up --> guberniya_final.zip http://imgur.com/a/1R4Kl
It's not even the real clever hacks and actual tricks that are used in tiny size compos that trigger the AV. Stuff like polymorphic self-modifying code (to name one actual trick) is generally only used for size compos smaller than 4096 bytes.
It is really just the executable packers that trigger these shitty AV "heuristics"[0]. Not just the demoscene-tools like kkrunchy, but also more "mainstream" ones like UPX. IIRC, certain versions of Opera were packed with UPX, also occasionally triggered the odd virus scanner.
It pissed me off here because they're smearing one of my favourite art forms. Most of the time they don't even qualify it as a "possible threat", but dig up an actual scary-looking malware name from the database and say it's GenericMalDestructoTerroristLoader.1 or whatever.
It's ridiculous. Imagine a world where most virus scanners trigger when they detect minified/uglified JavaScript. Certainly, web-based malware exploits use that for obfuscation.
For commercial AV vendors, false positives are in fact good for business. A virus scanner that never reports anything ever (because you have the good sense not to click on attachments or unexpected download/install/admin prompts) doesn't have a lot of perceived value. That's why at some point, all the virus scanners also wanted to scan your PC for "tracking cookies", which is not their job at all, but made it seem like they do something. Compare to something like MS Security Essentials, whose incentives are the opposite, and aligned with yours: they want Windows to appear as a solid and secure OS, so the scanner keeps quiet doing its darnedest to keep the user from getting hacked.
[0] Weirdly enough, when you apply a packer to a piece of malware that would otherwise be detected as is, it suddenly foils the virus scanner. Especially if you stack two different packers. Can't find the link where they researched this but IIRC, Kaspersky called out the research as "irresponsible".
Not necessarily. The marching is used to sample a volume to find intersections (or density), so you can absolutely march secondary rays for shadows, reflections etc.
http://9bitscience.blogspot.se/2013/07/raymarching-distance-...
Smaller intros like 4ks, on the other hand, will often use assembly (although completely shader-based ones are becoming more common).
In this particular case they noted that they weren't size-constrained anyway.
I wrote a minifier specifically for these use-cases and it has been used in many demoscene productions: https://github.com/laurentlb/Shader_Minifier On a 64kB intro like Guberniya, it can save a few kilobytes (but size was not an issue for them) - after compression.
The obvious advantage of this is that you do not need to interrupt the 68k CPU, which in the era of single digit Mhz speeds, was very nice.
The blitter (and other things) could be controlled by the Copper..
The Copper can also wait for the Blitter to be ready, and the Copper can give the Blitter new instructions and start a new blit. The circle would be complete if the Blitter could blit into the hardware registers for the Copper and other chips, but it cannot. :-( I think the Atari STe Blitter can do that though.
But you can use the Blitter to modify the Copper list, so perhaps they together are Turing complete?
I guess one of the most difficult platforms for demo programming (in terms of having to write things from scratch) was PC in the DOS/Win16 era. You could get into 320x200x8bit graphics mode quite easily (the so called Mode 13h) but beyond that you were on your own.
Best think about standard hardware was that, if somebody wrote something faster/better than you did then their code was demonstrably better - you couldn't blame it on drivers or anything else.
I had this situation with somebody called Darek Mihocka who wrote an accelerated text function for the ST. I beat his code, he then came up with something nearly twice as fast as mine! I went crazy wondering how he did it until the 'move.p' instruction came to me, I shit you not, whilst I was asleep.
Good times, and a great way to learn how to code and more importantly what really happens on the machine underlying it.
With only a little bit of investigation, or even participation, it quickly becomes entirely clear that compos divide entries by hardware, and people in the demoscene don't ask oldschool 64ks to measure up to PC 64ks.
I recommend having a look at the various compo blocks on pouet: https://www.youtube.com/user/RevisionParty
It's not like a device driver has an undocumented "MakeAwesome()" call that modern 64k intros are abusing.