06 December 2020, 16:56 | #1 |
Registered User
Join Date: Sep 2008
Location: UK
Posts: 318
|
Is the A500 Blitter Any Good For Drawing Polygons?
I was reading an old Amiga magazine recently and they were interviewing the programmer for a flight simulator game (just at the moment I can't remember which one) for the A500.
He said the Blitter was only good for scrolling the (bitmap) mountains on the horizon. Why is this? because wasn't the blitter designed to draw lines and fill areas too? A lot of Atari ST polygon based flight simulators are often described as slightly faster in multi format reviews which does seem to imply the blitter is not much use So is the blitter really no good for drawing lines and polygons or is it just coders didn't know what they were doing back then? |
06 December 2020, 17:15 | #2 |
ex. demoscener "Bigmama"
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,624
|
The blitter itself is fine for drawing lines and filling polygons.
It gets complicated when you have overlapping or concave objects, though, and when there's many of them, it may be easier to just use the cpu and e.g. draw everything back to front. Also, using the cpu will give a massive boost when using faster processors, where using the blitter might not. |
06 December 2020, 17:20 | #3 |
<optimized out>
Join Date: Sep 2020
Location: <optimized out>
Posts: 321
|
I've done this. The payoff for using the Blitter only happens for fairly big polygons. But, if you can make a sensible split between small and big polygons then it can help. In my case the Blitter is clearing the screen, drawing the ground then drawing the big ground level details (concrete and water). Because I can intermix the calculations for this and other things with the blitting, the blitting becomes free. But I don't use the Blitter for drawing smaller things like other aircraft because it ends up costing more, and apart from the ground level details everything is very small, only a few words. For my next trick I'm going to try not using polygons for far away aircraft, but I'm not sure how bad that will look.
Last edited by Ernst Blofeld; 06 December 2020 at 17:41. |
06 December 2020, 17:54 | #4 | |
Registered User
Join Date: Sep 2008
Location: UK
Posts: 318
|
Interesting replies. Thank you
Quote:
|
|
06 December 2020, 18:01 | #5 | |
<optimized out>
Join Date: Sep 2020
Location: <optimized out>
Posts: 321
|
Quote:
By using the Blitter to do the clearing and background, you could get up to 1/3 of your time back. But that's less significant than it sounds, if you were getting 3fps you might get 4fps instead. |
|
06 December 2020, 19:04 | #6 | |
Registered User
Join Date: Sep 2008
Location: UK
Posts: 318
|
Quote:
That must take the Amiga a little ahead of the ST with it's marginally faster processor. You could even use Amiga sprites or BOBs for the small planes or small objects. There's a game on MEGA CD - Soulstar where all the animation frames (objects seen from different angles) are prestored - maybe like Wing Commander on Amiga. So could maybe do that with all objects of a smaller size and save even more cycles |
|
06 December 2020, 19:32 | #7 |
Lemon. / Core Design
Join Date: Mar 2016
Location: Tier 5
Posts: 1,212
|
If you're using the blitter to draw your polygons, generally you have to do this:
Clear the polygon buffer (it's just one bitplane) Draw lines to the polygon buffer Fill the polygon buffer Copy the polygon buffer to each bitplane of your frame buffer (by either 'or'ing of 'nand'ing) As the blitter works on rectangular areas, there are many cases where you'll be blitting a lot of dead space (imagine a polygon that is long and thin and diagonal). You might be able to subdivide the rectangle into smaller rectangles, but this is going to add more overhead. So there are many cases when a CPU based renderer would be faster (for example the diagonal example above, and probably small polygons where there is still a fair amount of blitter setup work to do), and there are also cases where the blitter will win hands down. Unfortunately due to the nature of 3D, most scenes would contain a mixture of cases at once... Last edited by DanScott; 06 December 2020 at 19:43. |
08 December 2020, 11:11 | #8 |
Registered User
Join Date: Sep 2019
Location: Essen/Germany
Age: 55
Posts: 463
|
You may take a look at this thread http://eab.abime.net/showthread.php?t=99179 as deimos was coding a flight simulator using the blitter.
|
08 December 2020, 19:01 | #9 |
Registered User
Join Date: Sep 2008
Location: UK
Posts: 318
|
Thanks for responses. I am going to read up on this. I still don;t understand why the CPU doesn't also write to rectangular areas? Because it still has to write in words/bytes etc? I am not an expert coder. I just have working knowledge of things
|
08 December 2020, 19:19 | #10 |
<optimized out>
Join Date: Sep 2020
Location: <optimized out>
Posts: 321
|
Exactly that. The CPU does one instruction at a time, which may result in one word being written. The Blitter is different, set it running and it will write many words until it is done, skipping a few at regular intervals such that the result looks like a rectangular area.
|
09 December 2020, 10:25 | #11 | |
Registered User
Join Date: Sep 2019
Location: Essen/Germany
Age: 55
Posts: 463
|
Quote:
The CPU has to work one instruction after the other. Doing what the Blitter does in code takes quite a complicated algorithm because of the bitplane organization. Moving the pixels to an arbitrary X position requires manual shifting accross word boundaries. The shifting is already expensive and doing it over word boundaries adds to it as well. The Blitter can do this automagically, which makes it much faster. |
|
09 December 2020, 21:48 | #12 | |
Registered User
Join Date: Sep 2008
Location: UK
Posts: 318
|
Quote:
|
|
09 December 2020, 21:59 | #13 | ||
Registered User
Join Date: Sep 2008
Location: UK
Posts: 318
|
Quote:
Quote:
|
||
11 December 2020, 12:20 | #14 |
Registered User
Join Date: Feb 2010
Location: Espoo / Finland
Posts: 818
|
|
11 December 2020, 17:23 | #15 |
Registered User
Join Date: Sep 2008
Location: UK
Posts: 318
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Drawing polygons: use only triangles or use bigger ones, splitting them if needed? | TCH | Coders. General | 14 | 02 April 2020 17:13 |
Puzzling: Blitter line drawing faster on second execution | Yragael | Coders. Asm / Hardware | 10 | 02 June 2019 22:52 |
Blitter line-drawing mode? | E-Penguin | Coders. Blitz Basic | 2 | 13 April 2019 21:37 |
Blitter line drawing: nothing happens | Crank | Coders. General | 21 | 25 April 2018 21:43 |
Using blitter for filling 3D polygons | kovacm | Amiga scene | 34 | 25 January 2018 15:30 |
|
|