Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!ut-sally!husc6!bu-cs!halleys!applix!scott From: scott@applix.UUCP (Scott Evernden) Newsgroups: comp.graphics Subject: Re: Amiga World Ray-tracing article... Message-ID: <444@applix.UUCP> Date: Mon, 20-Apr-87 11:35:08 EST Article-I.D.: applix.444 Posted: Mon Apr 20 11:35:08 1987 Date-Received: Tue, 21-Apr-87 01:07:38 EST References: <239@rocky.STANFORD.EDU> <662@aurora.UUCP> Reply-To: scott@applix.UUCP (Scott Evernden) Distribution: comp Organization: APPLiX Inc., Westboro MA Lines: 55 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? The Amiga can display 4096 colors using 6 bit planes in a mode called HAM (Hold-And-Modify) using the following trick: Each pixel is represented by a 6 bit value. If the top 2 bits are 0, then the low-order 4 bits are used as an index into a (16 entry x 12 bit wide) color lookup table supplying that pixel's color. If the top 2 bits are NOT 0, then they are 1, 2, or 3 and the low-order 4 bits are used to modify a primary color component of the preceeding (left neighbor) pixel. (i.e., MODIFY 4 bits of the 12 bit color value HELD from the last pixel). +-----------------------+ | 0 | 0 | X | X | X | X | +-----------------------+ \_____________/ \__________ 4 bit index into color lookup table; lookup table has 4 bits/primary (= 12 bits) +-----------------------+ | N | N | X | X | X | X | +-----------------------+ \_____/ \_____________/ \ \ new 4 bit primary value for (eg., RED) \ \_________ the pixel's color is the same as the \ preceeding pixel except the (eg., RED) \ 4 bit component is directly given here. \_ 01 - modify RED 10 - modify GRN 11 - modify BLU So, with this scheme, you effectively have 12 bit/pixel control, although you cannot use any 12 bit value anywhere. Consequently, HAM-mode Amiga images can tend to be a bit fuzzy in the vicinity of color edges, but if the color lookup table is designed correctly, then this problem can be minimized. DBW_Render actually computes 12 bit color values for the entire picture, and then computes a histogram of color usage in order to choose a "best" set of lookup table values to minimize this "fringing". - scott