D-Bug & Automation Forum
Old/Deprecated stuff >> The 20 years STE anniversary demo >> Screens' Post mortem!
https://d-bug.mooo.com/dbugforums/cgi-bin/yabb2/YaBB.pl?num=1259340918

Message started by ggn on 27.11.09 at 16:55:18

Title: Re: Screens' Post mortem!
Post by The Paranoid on 05.01.10 at 20:25:30
Nice thread :-)

So i guess it's my turn to bore everyone to death with a few notes about Cubes, Ribbons & 3D Flybys.

Prologue:
You guessed it, the idea was born after talking to Havoc, Chris, ggn, DBug and a few other people during some obscure PC demo compo being watched via live stream, presumable Assembly or Breakpoint or both. Slightly bored by about 10 entries showing cubes, 8 entries showing ribbons and 4 showing 3D flybys, RA and I decided to have a go at these effects on the STE. When RA decided to collect and assemble all screens for the megademo, it was fairly obvious that my contribution would be a screen consisting of cubes, ribbons and 3D flybys.

3D Flybys:
This was actually the first effect to be finished. The 3 pillars use 16 x 32 entry offset tables, 32 x 32 pixel textures and alpha layers. Each pillar has a top left coordinate in 3D space and a size which are being translated, rotated and projected like any other 3D object would be. Each pillar is then rendered to a temporary buffer before the BLiTTER brings each pillar to screen. Each pillar is only 3 bitplanes wide because then it's not required to generate a mask. First, i wanted each pillar to cast a shadow but didn't really know how to make that efficiently. After a weekend at RA's place and talking it over with RA and Zweckform, we decided to make a reflection instead and i figured that i could use the "other" 8 colours without having to generate a mask either - It works, but the reflections need to be clipped. RA rendered the first background picture for me and i optimised the restoring of the background according to the height of the background and a lot of time went into getting the raster half-way stable because of the BLiTTER arrangement and a music replayer that runs in Timer D, just because i wanted the screen to be Falcon compatible ;-)
However, RA's background was oversized so that background needed to be redrawn occassionally and even though RA has a fairly ingenious way of doing that effeciently, i just couldn't get it to work with all the sprite coordinates and all that stuff. I wasted a couple of weeks on this before Dan joined us and agreed to generate a new background that doesn't require to be redrawn occassionally - Saved my life!
The second offset table for the middle bowl was added, coordinate generation for the alpha layer, background to rotation angle coupling and finally, the fire routine, which, by the way, runs upside down because it's being brought to screen using the reflection routine.
505 then had the idea of fading the scene up, moving it a bit and then fading it down again multiply, which i considered a nice idea and implemented it that way - A good week after deadline, by the way ;-)
All in all, this screen is my first 3D BLiTTER sprite screen that actually works ...

Cubes:
This was engaged after my 3D experiments had reached a level of maturity in which they generated something else than errors, overflows and misplaced pixels. The gouraud routine itself is fairly straight forward but i'm a bit proud of not using an edge buffer, which took me a while. Again, the concept was pretty straight forward, draw cubes using hires c2p in 3 bitplanes, then use the BLiTTER to bring them to screen, 32 x 32 pixels in size and fully masked, of course. Due to the fact that only 8 colours could be used, i needed a dither algorithm which has been implemented in the c2p algorithm costing absolutely no additional CPU time in the innerloop and only 2 extra EXG instructions after converting a line.
Then, i spent quite some time on the movement tables. Every cube (there's 16) has its own movement table being generated by its displacement from the center and they're slightly delayed to make sure they don't all cross the center at the same time. Like Dan said, until then, the background was a skyline of Frankfurt, but Dan had the much better idea of putting the cubes "under water" by drawing the aquarium. He then asked whether it would be possible to make the cubes cause "bubbles" every now and then, which is a simple single pixel CPU sprite and was fairly easy to implement. Dan also proposed that each cubes "splashes" into the water when it appears, but due to the cube management, i found that terribly hard and due to the deadline i needed to make them simply "pop up" instead. However, i wanted to have them pop up synchronous to the music which required a completely new cube display management and was written 2 or 3 days after the deadline. Dan then also proposed to switch palettes occassionally and sent me some - Neat idea.
Added the scrolling and the screen was done.
Summary: 16 gouraud shaded cubes in 20 frames per second that's 3840 polygons per second on an 8MHz 68000 - Now go and beat this ;-)

Ribbons:
That screen definetly costed me a few years of my life and caused some grey hair. The initial idea was to use a real 3D object to draw the "ribbon(s)" and i already had the fundamental routine, generating a light-sourced cube in 14 colours, expanded to 21 using a brother of the dithering routine implemented for the cubes screen. The background was meant to use merely 2 colours so that i could cycle the other 14 that make up the ribbon to simulate a moving light source. In Dan's log above where he describes all the graphics, you can still see the initial implementation using the 3D object. However, there was basically no way of getting the light sourcing to work well with all rotation angles and the ribbons being drawn always had ugly edges and pixels where single pixels of polygons not really meant to be seen shone through. It was a mess and all my attempts to save it failed, even though i had already written a bezier routine to support the movement of the 3D object. After Dan had a few ideas of fixing the screen that didn't really work out to our satisfaction either, we decided to go for plan B and use a simple "shade bob" instead. The shade bob is actually being moved in a 3D space but that is basically not being used at all - my bad, i ran into overflow/underflow problems when designing the movement patterns and because of the deadline left out the usage of rotation/z-coordinate modification (My bad). Dan then drew the beautiful background picture and sent me some palettes for switching. The greetings are faded up/down in realtime and could even overlay the ribbon, but it looks ugly because it results in being far too bright.
Summary: The weakest screen of them all, using only hardware scrolling of the STE features. But for displaying greetings, it does its job.

Title picture:
I actually drew most of that before Dan joined us, Dan added the moon surface then.

Music:
Like i said, i have wasted a lot of time on the Ribbons screen and the scroll routine of the 3D flyby so that i stopped sending preview screens to my crewmates which 505 accidentally misinterpreted as "giving up". When i then mailed him 2 weeks before the deadline, asking for a soundtrack, he was very surprised and, of course, not really amused of now having to make a soundtrack with virtually no background information about how the final demo will look like (style, sync etc). Nevertheless, he spent a funky weekend in front of his STE (ehem), sent me 2 music files the other day and that saved our contribution for the STE megademo.
Summary: MaxYMiser and 505 is a hard to beat combination!

I guess that's all there is to say about Cubes, Ribbons and 3D Flybys. I am quite happy with the result even though especially the Ribbons turned out different than i had in mind.

Epilogue:
After november 29th, RA was terribly busy putting it all together and i virtually donated my MegaSTE for testing, so RA kept sending me versions of his intro and we could get it to work cleanly on christmas eve at around 6 p.m. While i was doing christmas preparations, he was revising his code, while i was testing his code, he was doing christmas preparations. So the 24th and a bit of the 25th of December were spent in front of the STE indeed - Now that's dedication, isn't it ?

And that's my story behind the 20 years STE megademo.


The Paranoid of Paradox
Alive on a dead machine - That's Paradox!

D-Bug & Automation Forum » Powered by YaBB 2.6.0!
YaBB Forum Software © 2000-2020. All Rights Reserved.