Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!ima!mirror!xanth!kent From: kent@xanth.UUCP Newsgroups: comp.graphics Subject: Re: Amiga World Ray-tracing article... Message-ID: <849@xanth.UUCP> Date: Sat, 18-Apr-87 03:54:47 EST Article-I.D.: xanth.849 Posted: Sat Apr 18 03:54:47 1987 Date-Received: Sun, 19-Apr-87 00:34:59 EST References: <239@rocky.STANFORD.EDU> <662@aurora.UUCP> Reply-To: kent@xanth.UUCP (Kent Paul Dolan) Distribution: comp Organization: Old Dominion University, Norfolk Va. Lines: 95 In article <662@aurora.UUCP> jbm@aurora.UUCP (Jeffrey Mulligan) writes: >in article <239@rocky.STANFORD.EDU>, ali@rocky.STANFORD.EDU (Ali Ozer) says: >+ >+ In article <647@puff.WISC.EDU> beilke@puff.WISC.EDU (Matthew Beilke) writes: >+>Make that 320X400 6-bit H.A.M. The Amiga doesn't have the capability to >+>display > 6 bit planes. >+ >+ Despite that (just to set the record straight for comp.graphics >+ readers not familiar with the Amiga), the Amiga can display 4096 >+ colors at once, using 6 bit planes. > >Could you elaborate a bit on how they achieve this remarkable feat? >(No sarcasm intended.) > >With the systems I have used (a set not including the Amiga): > ># colors that can be displayed AT ONCE = 2 ** ( # of bit planes ) > ># of "distinct" colors = 2 ** ( r_DAC_bits + g_DAC_bits + b_DAC_bits ) > >The word distinct is quoted since rgb triples which are distinct >from a programming standpoint may not be perceptually distinct. I'll take a shot at this one, I think it's neat! First, the Amiga has 4 bits per color gun, so it is capable of producing 4096 (2**(4+4+4)) colors on the color monitor. Second, the Amiga's usual mode is 1, 2, 3, 4, or 5 bits through a color look up table which translates these into any 2, 4, 8, 16, or 32 of those 4096 colors, depending upon which sets of 12 bits are loaded into the output side of the color look-up table. Third, the Amiga has the bandwith to memory to pull out and translate up to 6 bits per pixel at the monitor's display rate, so the designers took the opportunity to do something really flashy. (As an aside, in the Amiga's memory, each bit plane is stored in a separate string of bits, rather than putting the 1, 2, 3, 4, 5, or 6 bits per pixel together in the memory.) (Here comes the H.A.M - Hold And Modify) Fourth, using six bits, the Amiga in HAM mode is working with a 4 bit deep (16 color) color lookup table. So, what are the other (top) two bits for? They form a code telling what to do with the bottom 4 bits. I don't remember which is which, but it doesn't matter...the codes are 0 to 3. 0 : use the bottom four bits as the address of the color look up table, with which to pull out one of the 16 colors, and assign that color to this pixel. Remember which 12 bits came out of the color lookup table (the Hold part). 1 : use the bottom 4 bits to replace the 4 red bits in the held color, assign that color to this pixel (the Modify part). Remember the new 4 red bits and the old 8 green and blue bits (the Hold part again). 2 : use the bottom 4 bits to replace the 4 green bits in the held color, assign that color to this pixel (the Modify part). Remember the new 4 green bits and the old 8 red and blue bits (the Hold part again). 3 : use the bottom 4 bits to replace the 4 blue bits in the held color, assign that color to this pixel (the Modify part). Remember the new 4 blue bits and the old 8 red and green bits (the Hold part again). The result is that you can't get an arbitrary assortment of 4096 colors at each pixel, but, since real scenery (TV stuff) has lots of spatial coherence, with a suitable choice of the base 16 colors in the lookup table, you can get pictures of near photographic quality, with just a bit of fringing at very sharp color borders. Since it can take up to 4 pixels = 24 bits to fully specify an arbitrary color, the previous poster's no free lunch note is completely correct, and the Amiga doesn't violate it; just in the real world, most pictures are much better behaved than the worst case, and so this is a pretty efficient encoding for normal pictures. I'd brag about on how clever they were a bit more, but I liked my Amiga so much I put my IRA in Commodore stock, so I'm not an unbiased observer any more. ;-) I hope that was clear enough to help. Kent. -- The Contradictor Member HUP (Happily Unemployed Programmers) // Also // A Back at ODU to learn how to program better (after 25 years!) \\ // Happy \// Amigan! UUCP : kent@xanth.UUCP or ...{sun,cbosgd,harvard}!xanth!kent CSNET : kent@odu.csnet ARPA : kent@xanth.cs.odu.edu Voice : (804) 587-7760 USnail: P.O. Box 1559, Norfolk, Va 23501-1559 Copyright 1987 Kent Paul Dolan. How about if we keep the human All Rights Reserved. Author grants free race around long enough to see retransmission rights, recursively only. a bit more of the universe?