amiga.org
     
iconAll times are GMT -6. The time now is 02:12 PM. | Welcome to Forum, please register to access all of our features.

» Amiga.org » Amiga computer related discussion » General chat about Amiga topics » Subpixel-corrected lines and polygons on Amiga

General chat about Amiga topics This forum is for conversations which are specifically "Amiga" related, but don't fit into other categories. Contents of this forum do appear on the main page, unlike Talk About. If a subject appears to be non-related, it will be moved to Talk About.

Reply
 
Thread Tools Display Modes
Old 01-12-2012, 06:46 AM   #1
Scali
Merely Curious
Points: 255, Level: 5 Points: 255, Level: 5 Points: 255, Level: 5
Activity: 12% Activity: 12% Activity: 12%
 
Join Date: Jan 2012
Posts: 11
Default Subpixel-corrected lines and polygons on Amiga

Hello,

Some of you may already have seen my post on abime.net, but if not, I'd like to share it here as well:

I have recently picked up programming on the Amiga again, and decided to tackle the age-old problem of rendering polygons using the Amiga blitter.
I have kept a log of my progress, which you can find here (yes, it also includes some PC/DOS programming stuff, the Amiga stuff starts in part 2):
http://scalibq.wordpress.com/2011/11...d-skool-style/

But in particular I'd like to share parts 5 and 5.1, because after dissecting the blitter's capabilities, I realized that it was possible to apply subpixel-correction to the lines, at relatively low extra cost:
http://scalibq.wordpress.com/2011/12...t-real-part-5/
http://scalibq.wordpress.com/2012/01...real-part-5-1/

Hope you guys like this little trick.
Scali is offline   Reply With Quote
Old 01-12-2012, 07:27 AM   #2
Piru
' union select name,pwd--
Points: 30,457, Level: 100 Points: 30,457, Level: 100 Points: 30,457, Level: 100
Activity: 69% Activity: 69% Activity: 69%
 
Piru's Avatar
 
Join Date: Aug 2002
Location: Helsinki, Finland
Posts: 6,946
Default Re: Subpixel-corrected lines and polygons on Amiga

Nice reading.
Piru is offline   Reply With Quote
Old 01-13-2012, 08:45 AM   #3
Scali
Merely Curious
Points: 255, Level: 5 Points: 255, Level: 5 Points: 255, Level: 5
Activity: 12% Activity: 12% Activity: 12%
 
Join Date: Jan 2012
Posts: 11
Default Re: Subpixel-corrected lines and polygons on Amiga

Thanks Piru!
Didn't we used to hang out together in #amycoders years ago?
In which case, ltns!
Scali is offline   Reply With Quote
Old 01-13-2012, 08:47 AM   #4
Piru
' union select name,pwd--
Points: 30,457, Level: 100 Points: 30,457, Level: 100 Points: 30,457, Level: 100
Activity: 69% Activity: 69% Activity: 69%
 
Piru's Avatar
 
Join Date: Aug 2002
Location: Helsinki, Finland
Posts: 6,946
Default Re: Subpixel-corrected lines and polygons on Amiga

Quote:
Originally Posted by Scali View Post
Thanks Piru!
Didn't we used to hang out together in #amycoders years ago?
In which case, ltns!
Yes we did
Piru is offline   Reply With Quote
Old 01-13-2012, 09:03 AM   #5
bloodline
Master Sock Abuser
Points: 37,111, Level: 100 Points: 37,111, Level: 100 Points: 37,111, Level: 100
Activity: 10% Activity: 10% Activity: 10%
 
bloodline's Avatar
 
Join Date: Mar 2002
Location: London, UK
Posts: 11,656
Blog Entries: 3
Default Re: Subpixel-corrected lines and polygons on Amiga

Awww! Get a room you two

Seriously, fun read! I never knew the old PC gfx chips had so much hardware in them!
__________________
My iPhone Game: Puny Humans -
http://itunes.apple.com/gb/app/puny-...362230281?mt=8
bloodline is offline   Reply With Quote
Old 01-13-2012, 09:21 AM   #6
commodorejohn
Kindred of Babble-on
Points: 8,703, Level: 62 Points: 8,703, Level: 62 Points: 8,703, Level: 62
Activity: 66% Activity: 66% Activity: 66%
 
commodorejohn's Avatar
 
Join Date: Mar 2010
Location: Duluth, Minnesota
Posts: 2,547
Blog Entries: 8
Default Re: Subpixel-corrected lines and polygons on Amiga

Quote:
Originally Posted by bloodline View Post
Seriously, fun read! I never knew the old PC gfx chips had so much hardware in them!
Neither did I, until I started reading Michael Abrash's Black Book. EGA and VGA especially are just loaded with features you never hear about anywhere else, it's a shame so few games take advantage of them. (Dangerous Dave in the Haunted Mansion does, I think Jazz Jackrabbit probably uses them as well, but a whole lot of stuff just uses unadorned framebuffer graphics.)
__________________
Amiga 1200 (KS3.1/ClassicWB3.1, 4GB HD, 34MB RAM, 68030 @ 50MHz)
DEC VAXStation 4000/60 (OpenVMS 7.3, 9GB HD, 104MB RAM, KA46 @ 55MHz)
DEC MicroPDP-11/73 (RT-11, 32MB HD, 4MB RAM, KDJ11 @ 15MHz)

"'Legacy code' often differs from its suggested alternative by actually working and scaling." - Bjarne Stroustrup
commodorejohn is offline   Reply With Quote
Old 01-13-2012, 10:26 AM   #7
Scali
Merely Curious
Points: 255, Level: 5 Points: 255, Level: 5 Points: 255, Level: 5
Activity: 12% Activity: 12% Activity: 12%
 
Join Date: Jan 2012
Posts: 11
Default Re: Subpixel-corrected lines and polygons on Amiga

Hum, am I on the right forum?
But yea, I guess part of why us Amigans weren't impressed much with the PC platform was that PC programmers didn't use the hardware to the fullest.
Sure, even though EGA and VGA have some trickery, they're not quite as advanced as the Amiga's blitter. On the other hand, they're not as bad as 'just a framebuffer'. Mind you, EGA has sort of a 'chunky2planar' mode built in, which the Amiga does not (with the exception of the Akiko chip in the CD32... and why didn't they put it in standard A1200 and A4000? They would have made wolf3d/doom clones easier and faster, and the Amiga may have survived as a gaming platform longer).

I guess the same can be said for Atari ST. Not as advanced as an Amiga, but you could do some clever tricks (and later models DID have a blitter, I only found that out much later. Again, not as good as the Amiga one, but nevertheless, better than nothing). There just weren't that many great games and demos that showcased them. In retrospect, I think some Atari ST demos may actually be even more impressive than Amiga demos.
Scali is offline   Reply With Quote
Old 01-13-2012, 10:46 AM   #8
bloodline
Master Sock Abuser
Points: 37,111, Level: 100 Points: 37,111, Level: 100 Points: 37,111, Level: 100
Activity: 10% Activity: 10% Activity: 10%
 
bloodline's Avatar
 
Join Date: Mar 2002
Location: London, UK
Posts: 11,656
Blog Entries: 3
Default Re: Subpixel-corrected lines and polygons on Amiga

The c2p function provided by Akiko was of little real value... As soon as you have fastram, the CPU can outperform it. A true chunky mode would have been much more welcome

-edit- Though it should be noted that we did get the Akiko c2p free with the CDROM controller, where as fast ram would have added a few more cents to the cost of the machine and Commodore couldn't entertain that idea
__________________
My iPhone Game: Puny Humans -
http://itunes.apple.com/gb/app/puny-...362230281?mt=8

Last edited by bloodline; 01-13-2012 at 10:48 AM..
bloodline is offline   Reply With Quote
Old 01-13-2012, 12:04 PM   #9
Piru
' union select name,pwd--
Points: 30,457, Level: 100 Points: 30,457, Level: 100 Points: 30,457, Level: 100
Activity: 69% Activity: 69% Activity: 69%
 
Piru's Avatar
 
Join Date: Aug 2002
Location: Helsinki, Finland
Posts: 6,946
Default Re: Subpixel-corrected lines and polygons on Amiga

Quote:
Originally Posted by Scali View Post
I guess the same can be said for Atari ST. Not as advanced as an Amiga, but you could do some clever tricks (and later models DID have a blitter, I only found that out much later. Again, not as good as the Amiga one, but nevertheless, better than nothing). There just weren't that many great games and demos that showcased them. In retrospect, I think some Atari ST demos may actually be even more impressive than Amiga demos.
I have to agree. Some of the Atari stuff is just mind-boggling, especially considering the limitations. I've had many very interesting chats with Wiztom of Aggression (he's a game developer at Housemarque btw) about Atari and how the custom HW differ from Amiga.
Piru is offline   Reply With Quote
Old 01-13-2012, 02:22 PM   #10
Zac67
Kindred of Babble-on
Points: 12,421, Level: 72 Points: 12,421, Level: 72 Points: 12,421, Level: 72
Activity: 15% Activity: 15% Activity: 15%
 
Zac67's Avatar
 
Join Date: Nov 2004
Location: Erlangen, Germany
Posts: 2,851
Blog Entries: 4
Default Re: Subpixel-corrected lines and polygons on Amiga

@Scali

Pretty cool. Thinking that it took >25 years to find out what the Blitter really can do kinda scares me...
Zac67 is offline   Reply With Quote
Old 01-13-2012, 09:01 PM   #11
bbond007
Defender of the Faith
Points: 8,793, Level: 63 Points: 8,793, Level: 63 Points: 8,793, Level: 63
Activity: 26% Activity: 26% Activity: 26%
 
bbond007's Avatar
 
Join Date: Mar 2009
Posts: 1,265
Default Re: Subpixel-corrected lines and polygons on Amiga

Quote:
Originally Posted by Piru View Post
I have to agree. Some of the Atari stuff is just mind-boggling, especially considering the limitations. I've had many very interesting chats with Wiztom of Aggression (he's a game developer at Housemarque btw) about Atari and how the custom HW differ from Amiga.
I read somewhere that Atari ST emulation requires more precise CPU emulation that is necessary for Amiga and MAC emulation. I don't believe I have ever seen an actual Atari ST in action.

I remember seeing Ultraforce Vector demo back when I had a 286 with Tsing et4000 VGA and that demo was the first demo I had seen on the PC that impressed me. I also had an A500 at the time. Most everything else up to that was just some fake raster bars and scrolling text done with pure CPU brute force. the other impressive thing to consider about the Vector demo is that the PC's SandBlaster card of that day had one grainy 8 bit channel so they are doing some CPU sound mixing there too.

VGA was not really bad hardware at all. The bigger issue was the brain-dead CPU it was attached to with the 64K segmented architecture. Still, I loved the Borland Turbo C and Turbo Pascal IDE. That is what really got me into programming. One really good source for banging the VGA (and other) hardware in Turbo Pascal was SWAG. Unfortunately I can't find the archive with the nice original DOS based reader.

Sadly I never programmed on the Amiga in anything other than basic.
bbond007 is offline   Reply With Quote
Old 01-14-2012, 04:35 AM   #12
Karlos
Sockologist
Points: 48,752, Level: 100 Points: 48,752, Level: 100 Points: 48,752, Level: 100
Activity: 8% Activity: 8% Activity: 8%
 
Karlos's Avatar
 
Join Date: Nov 2002
Location: I solve practical problems...
Posts: 16,606
Blog Entries: 18
Default Re: Subpixel-corrected lines and polygons on Amiga

Welcome to the site. As intro posts go, that was pretty interesting stuff. I only read the last part so far, so I think I'll grab a quick brew and read the rest.


Quote:
Originally Posted by Scali View Post
Hello,

Some of you may already have seen my post on abime.net, but if not, I'd like to share it here as well:

I have recently picked up programming on the Amiga again, and decided to tackle the age-old problem of rendering polygons using the Amiga blitter.
I have kept a log of my progress, which you can find here (yes, it also includes some PC/DOS programming stuff, the Amiga stuff starts in part 2):
http://scalibq.wordpress.com/2011/11...d-skool-style/

But in particular I'd like to share parts 5 and 5.1, because after dissecting the blitter's capabilities, I realized that it was possible to apply subpixel-correction to the lines, at relatively low extra cost:
http://scalibq.wordpress.com/2011/12...t-real-part-5/
http://scalibq.wordpress.com/2012/01...real-part-5-1/

Hope you guys like this little trick.
__________________
OCA
This isn't SCSI... This is SATA!!!
I have CDO. It's like OCD except all the letters are in ascending order. The way they should be.
Core2 Quad Q9450 2.66GHz / X48T / 4GB DDR3 / nVidia GTX275 / Linux x64, AROS, Win64
A1XE 800MHz / 512MB / Radeon 9200 / OS4.1
A1200T BPPC 240MHz / 256MB / Permedia 2 / OS 3.1 - OS3.9, OS4
A1200T Apollo 1240 28MHz / 32MB / Mediator1200 / Voodoo 3000 / OS3.9
A1200D Apollo 1240 25MHz (ejector seat ROM edition) / 32MB
Karlos is offline   Reply With Quote
Old 01-14-2012, 04:50 AM   #13
Scali
Merely Curious
Points: 255, Level: 5 Points: 255, Level: 5 Points: 255, Level: 5
Activity: 12% Activity: 12% Activity: 12%
 
Join Date: Jan 2012
Posts: 11
Default Re: Subpixel-corrected lines and polygons on Amiga

Quote:
Originally Posted by bbond007 View Post
I read somewhere that Atari ST emulation requires more precise CPU emulation that is necessary for Amiga and MAC emulation. I don't believe I have ever seen an actual Atari ST in action.
Sounds reasonable yes. On Amiga, most time-critical stuff is done with the copper, not the CPU. So the copper emulation needs to be very precise, but the CPU generally doesn't.
Atari is more like a C64, where you often craft code to run exactly X cycles, then you change some hardware registers at exactly the right pixel.

Perhaps this is not the best place to admit it... But I have an Atari ST myself. I got it after its prime though, somewhere in 1997 or so I think. See, one of my other hobbies is music, and I wanted an Atari for Cubase. I've tried a few games and demos on it, but concluded they were not as good as the Amiga. Partly because I didn't 'get' them, I suppose. I mean, a lot of Atari demos use fullscreen parallax scrolling effects. To an Amiga guy that's a bit of a 'so what?'. But if you know what hoops the Atari guys had to jump through to make it possible on their machine, it's a different story.
There's not a lot of 3d stuff on Atari ST... But this one is pretty incredible: http://www.pouet.net/prod.php?which=109
And that's just software too, not even using the blitter found on the later models.

I have no excuse for the music though... even a C64 sounds better than the Atari ST, if you ask me.

Quote:
Originally Posted by bbond007 View Post
I remember seeing Ultraforce Vector demo back when I had a 286 with Tsing et4000 VGA and that demo was the first demo I had seen on the PC that impressed me. I also had an A500 at the time. Most everything else up to that was just some fake raster bars and scrolling text done with pure CPU brute force. the other impressive thing to consider about the Vector demo is that the PC's SandBlaster card of that day had one grainy 8 bit channel so they are doing some CPU sound mixing there too.
Yea, that's when PC scene started to get serious. Around 1990/1991 the first modplayer routines appeared on PC, and soundcards started getting support.
3d was still mostly bruteforce, but that was exactly what the PC was good at. The 286 was already a much faster CPU than the 68000, with speeds up to 25 MHz.
And VGA was nicer for chunky effects, as it had a native chunky format.

Quote:
Originally Posted by bbond007 View Post
VGA was not really bad hardware at all. The bigger issue was the brain-dead CPU it was attached to with the 64K segmented architecture.
I think the sad part is that the 386 had been around since 1985, but it took until about 1992 before 32-bit code became commonplace. DOS did not support the 32-bit mode, and there were no alternatives, until eventually the DOS extenders arrived.
But it makes the Vectordemo even more impressive I guess, because it just runs in 16-bit mode. I believe Triton's Crystal Dream is also purely 16-bit (Crystal Dream II is 32-bit though).

I'm still a bit in two minds about VGA. Some parts of it are nice... other parts are nasty. Chunky mode is nice, unchained mode is nice... But the latches being only 8-bit large is rather limited. Lack of proper blitting and shifting is also a shame. And the fact that you can only address 64k of memory at a time. That means that in chunky mode, you cannot use a backbuffer in videomem. In fact, having to use separate videomem in itself is nasty. Reading back videomem has always been a bottleneck. The only way to avoid that was to have a buffer in sysmem. But that meant you had to memcpy() it to videomem every frame. And with the slow ISA bus and no proper DMA to do that for you... it wasn't pretty. It wasn't really feasible until 486 and VLB arrived, and the copy speed was getting good enough.
Scali is offline   Reply With Quote
Old 01-14-2012, 05:19 AM   #14
NovaCoder
Premium Member
Points: 8,227, Level: 61 Points: 8,227, Level: 61 Points: 8,227, Level: 61
Activity: 63% Activity: 63% Activity: 63%
 
NovaCoder's Avatar
 
Join Date: Apr 2008
Location: Oz
Posts: 1,235
Blog Entries: 2
Default Re: Subpixel-corrected lines and polygons on Amiga

Cool interesting stuff, maybe I'll put some of it to use one day
__________________
Life begins at 100 MIPS!


ScummVM AGA, BOOM AGA, AmiQuake AGA, AmiQuake 2 AGA
NovaCoder is offline   Reply With Quote
Old 02-01-2012, 04:14 PM   #15
Mrs Beanbag
Technoid
Points: 2,572, Level: 30 Points: 2,572, Level: 30 Points: 2,572, Level: 30
Activity: 47% Activity: 47% Activity: 47%
 
Mrs Beanbag's Avatar
 
Join Date: Sep 2011
Location: Edinburgh, Scotland
Posts: 341
Default Re: Subpixel-corrected lines and polygons on Amiga

this is awesome, I am going to try this.

The planets on Damocles/Mercenary III are subpixel correct circles, which I remember thinking was rather neat.
__________________
Signature intentionally left blank
Mrs Beanbag is offline   Reply With Quote
Reply

Bookmarks

Tags
amiga , blitter , correct , lines , polygon , polygons , subpixel , subpixelcorrected

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump