14 September 2018, 14:25 | #1 |
Registered User
Join Date: Feb 2011
Location: Italy/Rome
Posts: 2,281
|
68000 vs Blitter on filling
Reading this post: How did games like Starglider 2 get such a high frame rate?, it seems that 68k on ocs/ecs is faster than blitter on polygons filling. It is that true? It is possible that blitter is worthless on it?
|
14 September 2018, 14:38 | #2 |
Registered User
Join Date: Apr 2018
Location: UK
Posts: 487
|
Weirdly I was just wondering the same after reading a few threads about No second prize etc. Can someone with knowledge give us a detailed answer?
|
14 September 2018, 15:27 | #3 |
Registered User
Join Date: Feb 2018
Location: London / UK
Posts: 112
|
Not an expert on the subject but CPU can be faster with small polygons that overlap. Blitter is very fast when displaying large filled areas or convex 3d objects. With any large polygon 3d objects the blitter would still be faster I'm sure but more complicated to use efficiently.
With the CPU when drawing a polygon you will set or unset the bits on the bitplanes as you want. If you've already drawn something on the screen it won't matter because the CPU logic can simply draw over everything. When drawing with the blitter you will first need to draw the edges of the polygon and then separately fill the areas between those edges. This means that if you have to draw over existing image data or other polygons you'll need to add extra passes to first draw the polygon into a clear buffer and only then you can copy it to the actual destination bitplane(s). This is probably what you'd need to do in a game. So for drawing a single 3 edge polygon to a 4 bitplane (16 colour) screen you will need to set up and call blitter quite a few times: - Clear temporary polygon buffer. 1 call. - draw every edge line separately. 3 calls. - fill the pixels inside the edges. 1 call. - set or unset bits in every destination bitplane separately. 4 calls. All this setting up gets costly so if you have very small polygons it will end up being faster to use the CPU. Maybe, I haven't finished any proper blitter 3d stuff yet |
14 September 2018, 15:50 | #4 |
It's coming back!
Join Date: Jul 2018
Location: comp.sys.amiga
Posts: 762
|
It is definitely faster to use the CPU to fill small polygons.
The difficulty is defining "small". |
15 September 2018, 20:19 | #5 |
Moderator
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,602
|
It can be faster for very small polygons, if the code is very optimized. But the same is true for any small blit; I think Mega Typhoon and likely other shooters use the CPU to plot bullets and missiles, for example.
|
15 September 2018, 22:16 | #6 |
Registered User
Join Date: Mar 2018
Location: Rome
Posts: 173
|
|
16 September 2018, 01:36 | #7 |
Lemon. / Core Design
Join Date: Mar 2016
Location: Tier 5
Posts: 1,209
|
The holy grail of amiga OCS 3D, would to be able to plot the edge points for a whole scene, before filling the screen in one blitter fill pass.
It's something i have researched over the last 25 years on and off... but have never got around to coding it up Pretty much what dodke says hits the nail on the head. When blitting polygons, the polys could be aligned in such a way that the blitter clear, fill & copy to screen passes are actually working on much more data than is required (due to the fact that blits work on rectangular areas). I am not sure if I ever saw a routine that actually split the poly into smaller more efficient blits |
16 September 2018, 12:28 | #8 |
It's coming back!
Join Date: Jul 2018
Location: comp.sys.amiga
Posts: 762
|
|
16 September 2018, 14:31 | #9 | |
Lemon. / Core Design
Join Date: Mar 2016
Location: Tier 5
Posts: 1,209
|
Quote:
Linedraw in itself is a large number of calculations and blitter setup per line that is drawn |
|
16 September 2018, 15:45 | #10 |
It's coming back!
Join Date: Jul 2018
Location: comp.sys.amiga
Posts: 762
|
|
16 September 2018, 22:24 | #11 |
Lemon. / Core Design
Join Date: Mar 2016
Location: Tier 5
Posts: 1,209
|
|
17 September 2018, 09:06 | #12 |
It's coming back!
Join Date: Jul 2018
Location: comp.sys.amiga
Posts: 762
|
It's really great that you've volunteered to do this.
|
17 September 2018, 09:18 | #13 |
Lemon. / Core Design
Join Date: Mar 2016
Location: Tier 5
Posts: 1,209
|
Well.. my time actually would be better spent investigating some other rendering method that I devised a little while ago
|
17 September 2018, 10:05 | #14 |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
|
|
17 September 2018, 10:25 | #15 |
Lemon. / Core Design
Join Date: Mar 2016
Location: Tier 5
Posts: 1,209
|
That's one method we looked at a couple of months ago, but made no progress
The other method is the one I mentioned a few replies ago. Original concept for this was thought up around 1992/1993, but only recently I have gone back to look at how it could be done efficiently |
17 September 2018, 10:44 | #16 | |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
|
Quote:
Yes, this should really be a good method, considering the properties of the blitter that 're-starts' to fill up in the whole rectangle when it finds the pixels in the right way. But what sure works well is to overlay the tasks: while calculating the vertices in the meantime use the blitter to draw/clean/fill since not all DMA cycles are occupied by the operation. Anyway there is too much variables to consider (number of planes, poly dimension and number, processor, fast ram..) so a best/faster method do not exists |
|
19 September 2018, 14:18 | #17 |
Registered User
Join Date: Feb 2011
Location: Italy/Rome
Posts: 2,281
|
what about doing line setup with cpu and filling the line with blitter using D=A? in this way we have to setup only 2 blitter register, and masking first word and last word with cpu, or blitter itself.
|
19 September 2018, 15:03 | #18 | |
Lemon. / Core Design
Join Date: Mar 2016
Location: Tier 5
Posts: 1,209
|
Quote:
Why don't you code it up and see if it's quicker |
|
19 September 2018, 15:23 | #19 |
Registered User
Join Date: Feb 2018
Location: London / UK
Posts: 112
|
Just code all 3 and do benchmarks on various different sizes. Put winners in a table based on some size attributes and use that table to select which method to use.
Done. Maybe also include versions with both blitter nasty and normal for the routines that use both the CPU and blitter for the hell of it. |
20 September 2018, 08:41 | #20 |
Registered User
Join Date: Feb 2011
Location: Italy/Rome
Posts: 2,281
|
Since @deimos have all code done we can ask him to implement this way: blitter line filling + cpu
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Using blitter for filling 3D polygons | kovacm | Amiga scene | 34 | 25 January 2018 15:30 |
Blitter filling speed, how much? | sandruzzo | Coders. Asm / Hardware | 7 | 03 July 2015 14:38 |
CPU Filling vs. Blitter Filling Routine | victim | Coders. General | 18 | 26 January 2014 02:15 |
Blitter filling routine used in games | Codetapper | Coders. General | 2 | 26 January 2012 10:20 |
Filling with the blitter... | Lonewolf10 | Coders. Tutorials | 7 | 13 September 2011 14:30 |
|
|