A.D.A. Amiga Demoscene Archive

        Welcome guest!

  

  

  

log in with SceneID

  

Demos Amiga Demoscene Archive Forum / Coding / Sanity - WOC effects.

 

Author Message
Toffeeman
Member
#1 - Posted: 20 May 2007 18:48
Reply Quote
Now we've coverd most the Sanity effects there are just a few left over :0)

How did Chaos do the 1 bitplane zooming scroll text in WOC in 1 frame ? Is it just done with curved cpu line drawing and blitter filling ? Certainly a very well executed effect.

Also the vector tunnel in Jesterday after the dog zoomer routine which is also used in WOC. Obviously reflected on the y axis using screen modulos and maybe reflected on the x-axis with blitter ? What other tricks did he use to get this in 1 frame ?

Thanks guys.
Blueberry
Member
#2 - Posted: 21 May 2007 10:59 - Edited
Reply Quote
Some qualified guesswork about the scroller...

There are a couple of things to consider:
- The filling
- The vertical scaling
- The horizontal scaling
- The sinus movements
- The representation of the font

Filling: The text is filled using vertical blitter filling. This works by setting two blitter sources with xor combination. One source is set at the first rasterline, the other source and the destination is set at the second rasterline, and the blit proceeds in forward direction. Thus, the blitter will xor the result for each line into the next line, creating the same effect vertically as the normal blitter fill does horizontally.

What needs to be drawn prior to filling is then, for each x position, the upper and lower edges of the text at that position.

Vertical scaling: The y positions at which to plot must be scaled by a (non-integer) factor. Since all of the text has the same height at any one time, this factor is the same throughout a frame, so the multiplication table for the scaling can be calculated once per frame to avoid having the tables for all scale factors in memory at the same time. This table will of course do the screenwidth multiplication at the same time.

Horizontal scaling: For each x position, the information needed for that position is: The font glyph, the (unscaled) x position within that glyph, the screen pointer to the word column in which to plot, and a bitmask with one bit set at the bit position within that word to plot at. Since just one horizontal pass is needed, this code is not particularly time critical, so normal fixed point interpolation should do fine here.

Sinus movements: Just add some sinus-varying value to the screen pointer before plotting.

Font representation: For each (unscaled) x position in each glyph, there must be a pointer or offset indicating where the y positions to plot at can be found, along with the number of positions to plot at (always even). The actual positions can just be bytes, in which case the code to plot one pixel would look something like this:

; A0 = Font data
; A1 = Scaling table
; A2 = Screen pointer
; D2 = Bit mask

move.b (a0)+,d0 ; unscaled y position * 2
move.w (a1,d0.w),d1 ; Screen offset
eor.w d2,(a2,d1.w)

To gain some speed, the font could instead contain the actual plotting code, like this:

; A1 = Scaling table
; A2 = Screen pointer
; D2 = Bit mask

move.w position*2(a1),d1 ; Screen offset
eor.w d2,(a2,d1.w)

However, this would make the font data 8 times as big, and there is not exactly plenty of memory to use (remember, WOC runs with just 512k RAM). The indirect plotting loop is probably fast enough, as the average number of pixels to be plotted per x position seems to be about 3.

That's it, and it doesn't even need self-modifying code. :-D
Toffeeman
Member
#3 - Posted: 22 May 2007 14:36
Reply Quote
Verticle blitter filling ! What a cool idea never heard of this before and so simple to. Did it get used much ? I wonder if verticle filling opens up many other effects.

I always thought there could be more to this effect than I thought cheers Blueberry.

If I change the code when its running in Winuae to not do the fill (stick a 0 when writing to bltsize or something) it might prove how it's doing this.
winden
Member
#4 - Posted: 23 May 2007 07:40
Reply Quote
That guesswork was spot on! :)

Synthesis/network sourcecode is available to download and contains an example of a 1bpl zoomer using this type of vertical filling. This demo was oriented to 030 machines so it was faster to calc the fill using cpu, but the technique is 100% the same since it was adapted from an a500 prototype which worked via blitter vertical fill.

Please notice also that uniform vertical scaling can be achieved via copper modulos, to skip (when zoomed out) or repeat (when zoomed in) scanlines.
d0DgE
Member
#5 - Posted: 24 May 2007 12:01
Reply Quote
Winden: can you please provide a DL link for that zoomer source :) ?
z5_
Member
#6 - Posted: 24 May 2007 12:16 - Edited
Reply Quote

 

  Please log in to comment

  

  

  

 

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