Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!sri-spam!ames!ucbcad!ucbvax!decvax!decwrl!labrea!rocky!ali From: ali@rocky.STANFORD.EDU (Ali Ozer) Newsgroups: comp.graphics Subject: Re: Amiga World Ray-tracing article... Message-ID: <246@rocky.STANFORD.EDU> Date: Fri, 17-Apr-87 19:25:32 EST Article-I.D.: rocky.246 Posted: Fri Apr 17 19:25:32 1987 Date-Received: Tue, 21-Apr-87 02:45:29 EST References: <239@rocky.STANFORD.EDU> <662@aurora.UUCP> Reply-To: ali@rocky.UUCP (Ali Ozer) Distribution: comp Organization: Stanford University Computer Science Department Lines: 66 Keywords: Amiga HAM mode In article <662@aurora.UUCP> jbm@aurora.UUCP (Jeffrey Mulligan) writes: >in article <239@rocky.STANFORD.EDU>, ali@rocky.STANFORD.EDU (I) say: >+ 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 Amiga has a palette of 4096 colors --- Thus, 4 bits for R, 4 bits for G, and 4 for B. The HAM (Hold and Modify) mode, uses 6 bit planes to display all 4096 colors on the screen at once. Six bit planes effectively give you 64 colors (2 ** 6) to choose from, so here's how they get all 4096: - You first load 16 color values (ie, 12 bit RGB values) into the low sixteen color registers. (The Amiga has 32 color registers.) Whenever you set a pixel to one of the colors 0..15, the color value from the corresponding register is used at that pixel location. This gives you a way to arbitrarily set any pixel to any one of 16 colors. Thus, 00xxxx means use color in color register xxxx. - If you use a color between 16 and 31, the system gets the color of the pixel immediately to the left of the pixel you are modifying and changes its RED component to the low order 4 bits of the "color". Thus, setting a pixel color to 01xxxx means to set the color of pixel to xxxxggggbbbb, where gggg and bbbb are the blue and green values of the previous pixel. - Using a color between 32 and 47 does the same for the GREEN component, and a color between 48 and 63 does the same for the BLUE component. Thus, if you do not make clever use of the 16 color registers, then going from one color to another can take as many as 3 pixels --- Ie, you could not represent sharp edges very nicely. BUT, amazingly enough, there are plenty of products out there that make good use of the HAM mode. You just have to "analyze" the picture and determine the best values to put in the 16 color registers available to you in this mode. For instance, DigiPaint lets you paint using 4096 colors at once. There are digitizers that digitize pictures into 4096 colors (but not in real time). A ray tracer program posted by Dave Wecker comes with a post processor that takes the "color" information generated by the ray tracer and converts it into a HAM picture. The results are stunning --- You get no "color banding" problems, for instance. (If you somehow get a chance, take a look at the picture entitled "glass." The picture appeared in PD, so anybody with an Amiga should have it...) The other modes of the Amiga are pretty straightforward and work normally --- using n bit planes to display 2**n colors chosen out of the palette of 4096. You can use upto 5 bit planes (32 color registers) in low-res modes (320 by 200 and 320 by 400) and upto 4 bit planes (16 color registers) in hi-res modes (640 by 200 and 640 by 400). (The 400 line modes are interlaced, and will flicker with "bad" choice of colors or in heavy flourescent light. I use the 640 x 400 mode with 4 colors "development" environment and with the right colors have no problem with flicker. Also you can actually expand the screen to 704 x 470 with no problems except the monitor display area.) Hope this was helpful. Ali Ozer, ali@rocky.stanford.edu ...!decwrl!rocky.stanford.edu!ali