Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!zephyr.ens.tek.com!tekig5!wayneck From: wayneck@tekig5.PEN.TEK.COM (Wayne C Knapp) Newsgroups: comp.sys.amiga.hardware Subject: Bitplanes - good or bad Keywords: writing a pixel Message-ID: <5917@tekig5.PEN.TEK.COM> Date: 29 Mar 90 01:38:47 GMT Organization: Tektronix Inc., Beaverton, Or. Lines: 84 After many countless hours of programming on my Amiga. I'm becoming to realize that a major short comming of the Amiga is the fact that it uses a bitplane memory design for graphics and any real graphics require the processor. I can see many advantages for bitplanes in simple games, but very few applications outside of games seem to really bennefit from bitplanes. I suppose that there are a lot of examples one can dream up like putting a image of a cockpit in the some of the front planes and the image of the outside terrain in the other bit planes which would make for a pretty hot fight type of simulation or game. However, if you want to do something else like just plotting a single pixel the problem of the bitplanes becomes apparent. I'm not taking about some simple games or some special simulation, I'm concerned about the more general problem of the user working on the screen and producing a image. I think this is fair since the Amiga is supposed to be best at animation, video type type things and multi-media stuff. The most basic operation to much of the graphics for these type of things is plotting a pixel. None of the custom hardware aids in this task, in fact in high res it works against you! This may sound shocking but if you think about it is clear. The copper mostly only does setting up of other hardware and syncing or the hardware during the display. It is very flexible at the tasks it is designed for but it is also very limited. Clearly the copper is no aid at all in actually writting to bitmaps. Almost every other display system I can think of has hardware that does what the Amiga copper does. Of coarse differently since designs vary widely, but still the same functions. I would say that the Amiga copper is more flexible than most display controllers, but that is basicly what it is, a display controller. It is useful sometimes but not for the general problem of plotting a pixel. What about the blitter? Well it is okay for moving blocks of memory, has very useful logical operations and can even be used for simple filling and line drawing. Still for the most part it isn't useful for general problems. It has several problems. One it requires a large amount of setup to use. Two it has a very limited amount of sources, (only three) and for many operations this means there is only two sources to use since one of the sources is often the destination. This limits the blitter to working on one bitplane at a time and also limits the complexity of the blits. My titler program I wrote (Animation:Titler) often uses up to 4 three source blits to render a character. At that point I may be far better of doing the blits with the CPU since I could keep much of the temporary information such as masks in CPU registers between bitplanes and greatly reduce the number of memory accesses needed to render the character. (Assuming a 68020 or better so that the blit code could live in on chip cache.) A lot of work to be sure but not more than writing the blitter interface code in the first place. The blitter certainly has its place, it is often useful, but sadly it doesn't do the job of just plotting a pixel reasonably. So now we are out of special hardware and we still have to plot the pixel. The CPU is the only choice. So now one has to do the following just to plot a pixel: Compute the work offset of the pixel in the bitplane Compute a mask for the pixel For each bitplane n { read the correct data word from the bitplane mask out the bit corresponding to this pixel. if the bit in the pixel corresponding to this bitplane is set or in a 1 into the word from the bitmap via the pixel mask write the correct word back to the bitplane } Which in simple terms means, at least 2 * (number of planes) for every plotted pixel. The more bitplanes there are the slower it goes. Due to this, I don't really want '24 bitplanes'. Minimum of 48 memory access per pixel plotted!!! There would be some programs that would run faster on C64s!!! However, just think about a packed pixed format where pixels are on 32 bit boundaries. Then to plot one pixel it only requires one write. It would be a little wasteful of memory if you are only using a few colors, but memory is getting cheap enough to make it reasonable. Blitting still works fine too. A 512x480x24 bit display would only require 720k of memory. One could go with pixels on word boundaries, this would cost only 360k for a display and would allow the same blitter to be used. These would be true color modes to make things simple. Clearly this would not compatible with the current system. If it was done on the Amiga it would have to be in addition to the current modes. However, a packed pixel mode would have much better performance for many types of graphics applications. Wayne Knapp