Coding with Balls

April 17, 2011

Bitplanes + colour registers = A private rainbow!

Filed under: Uncategorized — Tags: , , — codingwithballs @ 13:10

Most of the parts in Norwegian Kindness use a simple, but effective, trick to achieve a bit more colour and (all-important) Freshness. As the Amiga has bitplane-based graphics, regardless of whether your actual effect code works in a “chunky” 1-byte-per-pixel mode or not, we’re able to combine the output of the main effect code (your typical cube, tunnel or zoomer) with a separate colour overlay, somewhat similar to colouring a greyscale photo. From the CPU’s point of view this operation has no performance cost, as it’s handled by the Amiga graphics hardware instead of requiring explicit (CPU) per-pixel blending. The only additional overall impact is the increased DMA/memory traffic caused by the hardware having to read more bitplane data, but the exactly same cost would have been incurred by using all 8 bitplanes (i.e. rendering 256 colors) in the effect code itself. In “modern” demos this additional overhead is also negligible compared to the time spent by the CPU on various tasks.
As a result we can go from this (effect only, rendered in 64 colours with a linear greyscale palette):

to this (no change in effect code, only 2 bitplanes of static overlay added + a new palette with 4 * 64 entries):

without any performance impact whatsoever.

The 2 bitplane overlay used to “select” between the 4 different 64 colour palettes for each pixel in this case looks like this (colouring only for illustration purposes):

In the demo this trick was applied to almost all the effects (we’ve never cared much for subtlety), with the exception of the blue’ish voxel twister, the initial greyscale clouds, and the text screens. In most cases (as above) the effect itself uses 64 colours and therefore renders into 6 bitplanes (all effects are originally rendered in chunky pixel mode and then converted to bitplanes). This leaves 2 bitplanes for the colour overlay (since the Amiga AGA chipset supports a total of 8 bitplanes), allowing us to create a fairly low-resolution gradient with 4 different palettes. Two effects (the flying anti-aliased cubes and the red-white volume/grid effect) are instead rendered in 32 colours, providing 3 bitplanes / 8 palettes and a somewhat smoother gradient.

What could have been better?
As always things took a lot longer than expected, and even with top-notch Datastorm organizers extending deadlines until compo-start, and numerous friendly providers of Jaloviina, Aquavit and beer, there were issues we simply did not get around to fixing in time for release (as for the “final release” it was just intended to get the demo out, not change the demo noticeably).

In some parts the dithered static overlays are very noticeable, creating a visible aliasing effect and breaking the illusion of a smooth colour gradient. This could have been avoided/improved on both by making the overlays dynamic (animating them) and chosing colour gradients with less contrast between the 4/8 different palettes. It also appears that some video projectors and screens amplify the banding/aliasing effect, making it appear “worse than it actually is” (this might be caused by conversion of the 24bit Amiga colour output to 16bit RGB565, or similar gremlins in the pixel-tubes). During the development of the demo I considered toning down the colour gradient in some parts (for instance the orange-purple clouds), but eventually decided against it as I was afraid it would lose some of its effect on the big-screen (again with the subtlety…) Unfortunately I never got around to animating the overlays, which could have been done in an interrupt at 50Hz (i.e. higher than the effect refresh rate, thus creating an illusion of higher overall performance and a smoother final image). However, Ephidrena used this animated technique in their demo Dancing In Software Foam Oil (some might argue that the effect is less noteworthy, but the issues due to “steep gradients” are also a lot less noticeable).

April 15, 2011

Norwegian Kindness? Is that a joke?

Filed under: Uncategorized — Tags: , , — codingwithballs @ 17:03

Yes, it is.

But it’s also an AGA/68060 demo which was released at Datastorm 2011, where it won the Amiga demo competition.
Although the demo group Spaceballs hasn’t been completely dead in recent years, NK is still somewhat of a “comeback demo” as it’s our first production to contain new effects since around 2004 (rather than rehashed code from yesteryear mixed with blurred video borrowed from the internet). The ideas behind the different effects were thought out between 2005 and 2010, but the majority of the actual code (except for basic frameworks and the infamous ‘Texture Mapper from 1999’) was developed between September ’10 and February ’11.  Most of the effects were implemented in September and October (with testing and optimization cycles relying heavily on WinUAE, irc and email due to the lack of an actual Amiga). The actual “linking” and demomaking took place during one intense week right before Kindergarden (where we were unable to finish the demo) and 1.5 week before/during Datastorm.
As always the demo ended up as something quite different than what we originally planned, but in the end I’m fairly happy with it as an in-you-face effect show. The fact that we beat Ephidrena, the uncrowned kings of subtle design touches on Amiga (you won’t notice, but they know it’s there!), shows that good old-fashioned “flash the screen and keep hitting them with new effects”-design ™ still works with the retro-geeks of today.

The next post  deal with the colour gradient trick used in NK (and in the Eph/Kvg/RNO demo from Datastorm), before we get into some of the more effect-specific code later on.

Blog at