[comp.sys.apple2] Extended graphics

meekins@CIS.OHIO-STATE.EDU (timothy lee meekins) (01/25/91)

Tim's guide to extended graphics on the IIgs.

The Apple IIgs performs screen updates 60 times per second (double the
television standard of 30 FPS). Since 30 FPS is all that is needed, we can
use 60 FPS to our advantage. This includes alternating the color of a pixel
during each screen update, giving the illusion of an interpolated color. Our
eye does the blending for us.

How practical is this method? For example, if a gray scale palette is created,
by alternating colors, we can create 31 shades of gray from a base of 16 
colors. Since the palette doesn't change, we are forced to modify those pixels
which are to blended. If a large number of these pixels exist, then the pixels
cannot be updated quickly enough. For a picture of reasonable complexity, it
is most likely that the screen cannot be updated quickly enough for this new
method to be practical.

But is there a faster method? Yes. But using a faster method, like in any
computer science problem, you lose the ability of doing certain things.
If certain color entries in a palette are used specifically for the blended
colors, then only the palette entry needs to be changed, but this limits us
to 16 colors to palette, so we really don't gain anything. The best bet is
to use the original method, but with little complexity so that CPU can
keep up.

What about the ACS demo, Gradient.32?

The ACS demo pulls some simple tricks which isn't very practical unless you
want to perform a vertical gradient shading similar to what ACS did. ACS
used the palette updating methods using all 16 palettes. First a box was
displayed on the screen using the colors 0 and 1, but with different
palettes, as shown below:

Screen    Palette #

00000000    0
11111111    0
00000000    1
11111111    1
00000000    2
11111111    2
...etc...

Once this box has been drawn, all that is needed to do is to alternate
the palette color entry 1.

Even frames:

Palette  Color 0  Color 1
   0      000      000
   1      111      111
   2      222      222
   3      333      333
   4      444      444

etc...

Odd frames:

Palette  Color 0  Color 1
   0      000      111
   1      111      222
   2      222      333
   3      333      444
   4      444      555

etc...

So, as you can see, alternating colors gives us more colors, but at a high
cost, which can't be paid for in many situations.

Also, someone was asking if there are any mixed graphics mode programs.
Yes, take a look at Crystal Quest. The game graphics are 320 mode and the
score is 640 mode.



+---------------------------S-U-P-P-O-R-T-----------------------------------+
|/ Tim Meekins                  <<>> Snail Mail:           <<>>  Apple II  \|
|>   meekins@cis.ohio-state.edu <<>>   8372 Morris Rd.     <<>>  Forever!  <|
|\   timm@pro-tcc.cts.com       <<>>   Hilliard, OH 43026  <<>>            /|
+-------------------------S-H-A-R-E-W-A-R-E-!-------------------------------+

taob@pnet91.cts.com (Brian Tao) (02/09/91)

From meekins@CIS.OHIO-STATE.EDU (timothy lee meekins):

> Also, someone was asking if there are any mixed graphics mode programs.
> Yes, take a look at Crystal Quest. The game graphics are 320 mode and
> the score is 640 mode.

    I think Thexder use 640-mode graphics to display the scrolling view of the
game on top, and 320-mode for the stats and scores on the bottom.  I could be
wrong, but I recall seeing more than 4 pure colours on a line (check out the
Energy bar graph).

Brian T. Tao  {taob@pnet91.cts.com} ||  Computer guru?  Someone who got
University of Metro Toronto         ||  their computer a couple of weeks
Scarberia, ON, MIC 3A8         *B-) ||  before you did.  (Alvin Toffler)