A.D.A. Amiga Demoscene Archive

        Welcome guest!

  

  

  

log in with SceneID

  

Demos Amiga Demoscene Archive Forum / Coding / Blitter Zooming

 

Author Message
Toffeeman
Member
#1 - Posted: 26 Sep 2007 01:12
Reply Quote
Another Chaos effect :0)

I assume the zoomer at the start of Sanity - World of Commodore which zooms a image from 0,0 to 320,256 in 4/5 planes is a blitter zoomer. This effect can also be seen in Elysium (was that the first implementation ?). I think this has a limitation of it can't zoom bigger than the original image only smaller. So it can only skip pixels when drawing

Okay we all know you can stretch/shrink the y-axis just by adjusting the modulos with the copper down the scan lines no problem. So for the x-axis you could get the blitter to copy a single verticle line (1 pixel wide by 256 rows) and copy it it to each postion as required by using shifts and masks. This could probably do a small image in 1 frame but certainly not a full screen picture as in the Chaos version.

The problem with the above method is you are going to have todo 320 blits each 1*256 big and thats for 1 bitplane. Although the above method would allow to zoom bigger than the original image size. So he must have been smart with his copying and did 16 pixels at a time (as thats what the blitter does in 1 go) but I can't quite work out how he pulled it off. Any ideas ?
Blueberry
Member
#2 - Posted: 26 Sep 2007 09:28
Reply Quote
Yay, more Chaos guesswork! :-D

My guess (supported by looking closer at the effect) is that he scales each frame from the previous frame, blitting in a few lines from the original each time. This way, he only has to copy the whole picture once + some overlap at the seams + the lines from the original. Copying back and forth between two buffers, he also does not need to clear anything.

The picture takes a little more than 3 seconds to zoom fully, and the size seems to be growing linearly, which means that he blits in 2 lines from the original each frame. Thus, all that is needed is 3 big blits from the previous frame and 2 thin ones from the original.

Let's do some calculations...

The picture is 320x200 pixels in 4 bitplanes. That is 320/16*200*4 = 16000 words. With 140000 available blitter cycles per frame, this theoretically allows for fully cookie-cut masked blits at 8 cycles per word, but the masking is only needed at the words containing the seams, while the rest can be plain copying blits at 4 cycles per word. So there is a bit of time to be saved there (especially for the large zoom factors) by splitting the blits up further. The two thin blits from the original don't take much time.

With only 4 bitplanes and not much copper activity (just setting modulos once per scanline) the blitter can run at close to full speed. So the above method should easily fit within one frame.

Now, scaling is one thing. But later in the same demo (in part two) there is a combined scaling and rotating effect. It seems to be doing something similar - moving around parts of the picture and inserting new pieces - but how? :)
Boogeyman
Member
#3 - Posted: 27 Sep 2007 08:21
Reply Quote
Blueberry is spot on concerning the normal zoomer. You just made a randomish table determining which 2 pixel columns to insert.

As for the zoom/rotator, I don't remember how its done, but iirc it involves a combination of 102, modulo and prerotated images.
Toffeeman
Member
#4 - Posted: 27 Sep 2007 14:54
Reply Quote
Thanks guys ! Another cool way of using the Amiga. I thought you wouldn't be able to zoom bigger than the original image but using that technique you could. I wonder if the planet zoom at the start of Desert Dream uses it.

We've talked about Mr Pets 1*1 rotator before on here which is also used in the game Brian The Lion.

"As I write below, under chunky rotation, effects such as rotations are normally done in a "chunky" way. This program, however, performs an increasing skew of the image (think of it as a square slowly becoming a parallelogram), both horizontally and simultaneously vertically. The horizontal skew is accomplished by stepping the shift registers and bitplane pointers, while the vertical skew is done by an intricate blitter minterm and a table of masks that, for every degree of vertical shift, for every 16 bit word along the image's span from left to right, describe what pixels, in that word, are to be plotted one line below all the other ones. The table of masks were precalculated beforehand with a Pascal program that calculates the horizontal positions where the image will be "broken up" during the increasing shift, and aligns the data to 16-pixel segments, for blits. According to Pythagoras' Theorem, "the square of the hypotenuse equals the sum of the squares of the other two sides". Thus, the image has to be shrinked a bit in addition to the skewing, to preserve its shape. (This is done the usual way by making a copper list that skips certain scan lines). "

http://ada.untergrund.net/forum/index.php?action=v thread&forum=4&topic=140

Scroll down to full planar rotation:-
http://legolas.mdh.se/~dat95jed/prog/?prog68000.ht m
michael phipps
Member
#5 - Posted: 6 Oct 2007 07:00
Reply Quote
By The Way Mr Pet's version of his 1*1 rotater uses a precalculated Z axis rotation formulae!!! I know this because i looked in his code in his demo - Turmoil. Ooops sorry Mr Pet!!! hehehe...
michael phipps
Member
#6 - Posted: 6 Oct 2007 07:12
Reply Quote
BTW... Mr Chaos's version is REAL-TIME!

 

  Please log in to comment

  

  

  

 

A.D.A. Amiga Demoscene Archive, Version 3.0