home *** CD-ROM | disk | FTP | other *** search
- Tech-doc for HAM8bob
- --------------------
-
- This doc assumes that you are familiar with the way HAM works.
- The 64 solid colors in a HAM8 picture will henceforth be called 'base colors'.
-
- How is it done then?
-
- Simple really. First select your base colors in such a way as to minimize the
- maximum distance from a base color to any color in your HAM graphics.
- The simplest way to do this is probably to set the colors up in color cube of
- 2x2x2 bits. This is the way I've done it in this demo, so check the ILBMs to
- see what I mean.
- All background graphics must be drawn both in HAM8, and in the 64 base colors
- (see back.h8 and back.64.)
- The bobs are drawn in HAM8 in the following way:
- 1. Each pixel in the left edge(s) of the bob must be a base color.
- 2. Each bob has a 'right edge mask' that is set in the pixels that are
- just right of the bob (see example below.)
-
- --ASDA--- --####--- ------#--
- -FQWEQF_- -######-- -------#-
- POQ--LHA- ###--###- ---#----#
- NB----WE- ##----##- --#-----#
- EM----MA- ##----##- --#-----#
- POD--XKL- ###--###- ---#----#
- -ZXCMVD-- -######-- -------#-
- --OSLK--- --####--- ------#--
-
- BOB BOB MASK RIGHT EDGE MASK
-
- As you can see, you have to make the bob one pixel less wide, to have
- room for the right edge mask.
-
- When blitting in a bob, the bob itself will look right (since each row begins
- with a base color.)
- However, ugly color fringing will be visible around the right edge of the bob.
- So, you now blit from the 64 color version of the background through the right
- edge mask. This will make the pixel to the right of the bob almost the correct
- color, and color fringing will be much less visible.
-
- That's it!
-
- Conditions for this looking good:
- 1. The base colors must be well choosen.
- 2. The background must use plenty of smooth fades and color changes (no
- large single color areas), so that the fringes 'wear themselves out'.
-
- Feel free to steal code/ideas! I would love to see something impressive come
- from this.
-
- Johan Forsberg
- d92-jfo@nada.kth.se
-