New demo - Horizon (RISC OS, ARM2/3)

new graphics/music demos - bitshifters, 0xc0de, The Master + others
Post Reply
User avatar
SarahWalker
Posts: 1598
Joined: Fri Jan 14, 2005 3:56 pm
Contact:

New demo - Horizon (RISC OS, ARM2/3)

Post by SarahWalker »

Hi everyone!

As keiranhj mentioned in the Nova 19 thread, I've released a new Archimedes demo - Horizon. According to pouet.net, the last Arc demo that wasn't a port was released back in 2003, so this is the first for a while!

This is the 'party version' - ie it's a bit buggy. The target machine was a 2 MB A3000, but it should run on all ARM2/ARM3 machines with 2 MB and RISC OS 3 (though MEMC1 machines will be a little slow). It may/should work on A7000 and pre-StrongARM RiscPCs; I haven't actually tried this though. It definitely _won't_ work on StrongARM or 32-bit only machines at the moment. It also probably won't be great on VGA. I intend to release an updated 'final' version in the near future that fixes all of this.

I've attached it in both disc image and archive format. I've also uploaded it to YouTube : https://www.youtube.com/watch?v=wBypcptcg8Y
Attachments
Horizon.zip
(368.61 KiB) Downloaded 114 times
Horizon_(disc_image).zip
(371.91 KiB) Downloaded 100 times
User avatar
danielj
Posts: 9900
Joined: Thu Oct 02, 2008 5:51 pm
Location: Manchester
Contact:

Re: New demo - Horizon

Post by danielj »

Excellent work, Sarah :)

d.
User avatar
0xC0DE
Posts: 1300
Joined: Tue Mar 19, 2019 7:52 pm
Location: The Netherlands
Contact:

Re: New demo - Horizon

Post by 0xC0DE »

Great!! I saw it live on YouTube yesterday but had no idea you are "The Master" :D
I would be interested to get some technical details about the demo effects. Are you planning a write up?
0xC0DE
"I program my home computer / Beam myself into the future"
:arrow: Follow me on Twitter
:arrow: Visit my YouTube channel featuring my games and demos for Acorn Electron and BBC Micro
User avatar
IanS
Posts: 2535
Joined: Mon Aug 31, 2009 7:02 pm
Location: UK
Contact:

Re: New demo - Horizon

Post by IanS »

Looks good, and ran OK on my R140/ARM3/4MB.
User avatar
oss003
Posts: 3849
Joined: Tue Jul 14, 2009 12:57 pm
Location: Netherlands
Contact:

Re: New demo - Horizon

Post by oss003 »

WOW .... :shock:
Looks great, nice job Sarah.

Greetings
Kees
Last edited by oss003 on Sun Jun 23, 2019 11:43 am, edited 1 time in total.
User avatar
pixelblip
Posts: 4050
Joined: Wed Feb 04, 2015 7:19 pm
Location: London
Contact:

Re: New demo - Horizon

Post by pixelblip »

Very impressive....liked the music as well.....well done. I didn’t realise Nova 19 was on this weekend....
sirbod
Posts: 1624
Joined: Mon Apr 09, 2012 9:44 am
Location: Essex
Contact:

Re: New demo - Horizon

Post by sirbod »

Very good, didn't seem at all buggy to me. I ran it under ADFFS on a Pi3 and it looked okay to me.
User avatar
SarahWalker
Posts: 1598
Joined: Fri Jan 14, 2005 3:56 pm
Contact:

Re: New demo - Horizon

Post by SarahWalker »

Finally got the final/non-party version done. Fixes some glitches, improves a couple of parts, adds StrongARM and VGA support, and the music player doesn't go out of tune...
Attachments
HorizonFinal_(disc_image).zip
(374.69 KiB) Downloaded 102 times
HorizonFinal.zip
(372.09 KiB) Downloaded 98 times
User avatar
kieranhj
Posts: 1103
Joined: Sat Sep 19, 2015 11:11 pm
Location: Farnham, Surrey, UK
Contact:

Re: New demo - Horizon

Post by kieranhj »

A great excuse for me to set my office back up after all the unplugging for ABUG! I’ll see if I can make a decent video capture from real hardware at some point too.
Bitshifters Collective | Retro Code & Demos for BBC Micro & Acorn computers | https://bitshifters.github.io/
User avatar
SarahWalker
Posts: 1598
Joined: Fri Jan 14, 2005 3:56 pm
Contact:

Re: New demo - Horizon

Post by SarahWalker »

Following from the belated final version here's the belated writeup!

Loader
Loading screen was originally meant to be Farbrausch-style, but I decided this was boring and added the spinning balls. Screen is in MODE 9, the balls are preshifted and used to mask a solid colour.

Everything in the demo is compressed with a fairly noddy LZ77-style cruncher. The compression ratios aren't amazing, but it gets everything onto a single 800k disc and the decompression times are reasonable.

The loading addresses are way too high on the party version, hence 2 MB users can run low on memory and loose the music as a result. The final version heavily optimises this.

Music player
Plays a 4-voice S3M tune at 15.625 kHz on ARM2 machines, using about 10% of CPU time. The party version has bad music; I only got the music the morning of the compo, and it revealed a number of bugs in the playback module which I had to try to fix on zero sleep, as well as converting it from XM to S3M and compensate for any resulting issues. The result is that the sawtooth lead towards the end of the tune is out of tune on the party version and is missing all vibrato effects. The final version fixes this, and also boosts the playback rate to 31 kHz on > 8 MHz machines.

The buffer fill routine is heavily unrolled and makes use of the log sample format to attenuate samples using subtraction + clamping.

Wireframe effects
I originally intended to run this in MODE 9 and use palette effects for the trailing, so that I'd only have to unplot the oldest line and plot the newest every frame. Plotting 4bpp lines turned out to be _waaaaay_ too expensive though, so I ended up moving to MODE 13 - 1 byte per pixel turns out to be much easier and faster! However this did mean replotting everything every frame, so the levels of 'trailing' got reduced to compensate. In retrospect I should have moved to MODE 12 and doubled every pixel...

The line routine is an RLE-type, with a _lot_ of generated code - special cases for runs of 1, 2 and 3 pixels, and everything else calls a massive set of (from memory!) 64 routines by 4 dword starting offsets by 2 carry positions, with each routine doing plotting, updating error, checking remaining length, and jumping to the next routine. This is one of a number of effects that perform poorly on ARM3 machines; the effect still runs okay, but this is one of two effects where the VGA version runs with a scanline effect.

The initial lines with the green trail are a nod to the opening of Amnesia by Renassiance.

The Master Presents
This uses line drawing with XOR filling. I had intended to use this effect more often in the demo (I have a 320 triangle 50 fps light sourced sphere I wrote this way), but this is the only time it's used.

Horizon title
The title graphic is one of three images I threw together using Blender. My lack of artistic talent is pretty obvious throughout the demo!

I think the fade in & out worked quite well. In MODE 13 you can't do palette fades, and performing table lookups on every pixel is way too expensive to hit 50 fps. However, if you pixelate at the same time this reduces the number of lookups required and the resulting effect fits in a frame. There are 16 routines, one for each pixel size.

Gouraud shading
This is MODE 9, hence the monochromatic shading. The gouraud triangle plotter is highly optimised, calculating 2 pixels at once and using acres of generated code again, hence the effect is able to run in 2 frames. Lighting is based on a single directional light source, with faked specular lighting.

The final version fixes a few bugs in this effect, though there is still an overflow bug visible - this occasionally causes bright white pixels on the right hand edge of triangles. I also added an extra vertex in the middle of the hand to improve the lighting. The hand does slow down as it gets close to the camera, but the effect is fading out at that point anyway so it's not really a problem.

The spinning hand is a nod to Lost Blubb by Lazer.

Credits
Lava lamp effect is a bunch of sine waves driving a horizontal line plotter. That uses colours 0-3, the text uses 4, 8 and 12 and can therefore just be ORed over the top.

The system spec at the bottom is in response to a suggestion from keiranhj, that no one at NOVA would know what the machine running the demo actually was. I also made an 8 MHz reference in the blurb shown before the demo. Apparently a lot of people still ended up thinking this was targetting ARM3 somehow...

Texture mapping
The only effect that actually got a response from the NOVA audience.

This is MODE 9, with a monochrome texture & lighting. The object is entirely made of triangles to avoid showing how rough the affine texture mapping is; I initially used a cube but it looked a bit 'bendy'. Lighting is based entirely on distance from camera. I adjusted the lighting on the final version as the object went to near total black at a distance, which made it difficult to judge when the effect was ending.

Colour bars
MODE 15! This is basically a memcpy adventure, and had the issue of limited memory bandwidth, as it's not possible to copy a full screen in MODE 15 with music playing. It started as full screen, and got narrower and narrower to hit 50 fps.

The party version had full size bars as intended for the full screen effect, which looked slightly awkward with the narrower code when the order flipped. The final version has thinner bars, with a black outline as I thought it looked nice.

The lack of memory bandwidth means this is the other effect that runs with scanlines on ARM3.

Mid demo loader
Another quick Blender picture, this time in MODE 15 to get better differing. I intended to scroll this up from the bottom of the screen, but limited MODE 15 memory bandwidth hits again.

Top tip for demo coders - don't have massive loads in the middle of the demo. I could tell the NOVA audience were getting impatient.

Rotozoomer
2x2 rotozoomer in MODE 9 at 50 fps. This originally had an animated texture, but the effect was somewhat nauseous so I asked Dethmunk to draw the little Acorn devil (as a nod to Bitshifter's demo). The effect is a total cheat, calculating the integer source offsets for the first scanline then just reusing them for the rest of the screen, only altering the start of the texture. This looks fine when zoomed out, but when zoomed in + rotated it looks awful, hence why the rotating doesn't start for a second or two.

Voxels
The simplest effect in the demo; I think it's only about 60 instructions long! Runs in 3 frames with a 4x pixel size, but looks okay I think. The colours on the landscape are a bit crap.

Balls
This has either 28 or 30 balls (I can't remember which!) at almost constantly 50 fps in MODE 13. I originally intended to do span sorting to eliminate overdraw, but sorting the spans ended up more expensive than just drawing everything. To speed things up all geometry is precalculated, hence there's a delay of a few seconds on ARM2 machines at the start. There are occasional frame rate drops but triple buffering keeps everything reasonably smooth.

Greets tunnel
The tunnel is 2x2 and runs in MODE 13, with a custom palette to get 8 blue levels. The text is blended on top with a lookup table to fake alpha blending. The texts are decompressed and the different alpha'd images are calculated just before plotting.

The party version is _really_ unoptimised and has very frequent slowdown. The final version is a lot better, though there's still some minor slowdown on ARM2 machines. I also improved the opening and closing of the effect.

Final picture
The third and final Blender piccy. I think this is the best picture but the worst dithering; this really should have been in MODE 15 but I didn't think it would be fast enough. The fade out is calculated in advance.
User avatar
kieranhj
Posts: 1103
Joined: Sat Sep 19, 2015 11:11 pm
Location: Farnham, Surrey, UK
Contact:

Re: New demo - Horizon

Post by kieranhj »

Thanks for doing a write up Sarah, this is really interesting. It’s been so long since I did any ARM, I naively assumed there would be no need for lots of unrolled code but clearly I’m completely wrong! I think I managed a 4x4 pixel rotozoomer but that was my limit BITD.

There are a ton of awesome effects in this demo - probably enough for two full productions. I hope you will consider doing another one next year, despite this being a whole heap of work and clearly quite stressful getting everything in at the party. Someone has to fly the Archie flag!

FWIW, if I had to pick one, my favourite effect is probably Balls as I really like the clean style, choice of palette (esp not a black background), high frame rate even when close up with lots of fill and nice morphs. It’s a good throw down to similar Amiga effects which would be limited by bitplanes. Great job! =D>
Bitshifters Collective | Retro Code & Demos for BBC Micro & Acorn computers | https://bitshifters.github.io/
User avatar
roland
Posts: 5148
Joined: Thu Aug 29, 2013 9:29 pm
Location: Born (NL)
Contact:

Re: New demo - Horizon

Post by roland »

IMHO it is really impressive what you coders can do with graphics. I even don't manage to draw something beautiful and then make it move ... =D>
FPGAtom: 512 KB RAM, Real Time Clock and 64 colours
MAN WOMAN :shock:
Post Reply

Return to “new projects and releases: demoscene”