home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / graphics / 14271 < prev    next >
Encoding:
Text File  |  1993-01-28  |  3.8 KB  |  71 lines

  1. Newsgroups: comp.graphics
  2. Path: sparky!uunet!ftpbox!news.acns.nwu.edu!zaphod.mps.ohio-state.edu!sample.eng.ohio-state.edu!purdue!haven.umd.edu!darwin.sura.net!spool.mu.edu!uwm.edu!rpi!utcsri!psych.toronto.edu!dstampe
  3. From: dstampe@psych.toronto.edu (Dave Stampe)
  4. Subject: Re: 256 color faster than 16 color ...why?
  5. Message-ID: <1993Jan27.043103.4335@psych.toronto.edu>
  6. Organization: Department of Psychology, University of Toronto
  7. References: <C1FvJp.Hw9@acsu.buffalo.edu> <1k4j4dINNoo5@hobbes.telco-nac.com>
  8. Date: Wed, 27 Jan 1993 04:31:03 GMT
  9. Lines: 60
  10.  
  11. dave@telco-nac.com (David Cornejo) writes:
  12. >>    I've done some tests and found out that 256 is indeed much faster
  13. >>than 16 color at the same resolution.  Why is this?  I tested
  14. >>320x200x16 vs. 320x200x256, and 640x480x16 vs. 640x480x256, and
  15. >>800x600x16 vs. 800x600x256.  I figure that that covered all the
  16. >>memory ranges pretty well.  The 256 color out performed the 16 color
  17. >>by anywhere from 10%-40%!!!   The only possible explantion I can
  18. >>think of is that with 256 color they can to fast byte operations on
  19. >>memory vs. messing around with 4bits and shifting and all that.  Is
  20. >>this theory at all on the right track?
  21. >
  22. >I believe this is right or at least on the right track...
  23. >
  24. >In 16 color mode, the video memory is organized as 4 planes of 1 bit each,
  25. >requiring a lot of diddling of I/O ports & masks before you output the pixel.
  26. >Even when you write the pixel, you're not actually writing to the video
  27. >memory - the card has to jump through some hoops to write it to the memory
  28. >for you. In 256 color mode, I believe that you have direct (or at least
  29. >fast buffered) access to flat video memory. Michael Abrash (I hope that's
  30. >correct) covers this frequently in his column in Dr Dobbs, so you can check
  31. >back issues for a better explanation (I'm doing this from memory). I think
  32. >he has a book or a set of article reprints available too.
  33. >
  34. It depends what you're doing.  If you're doing pixel-by-pixel accesses
  35. (drawing a non-horizontal line, or texture mapping as in Castle Wolfenstein)
  36. then it's faster.  However, for almost anything else, multipixel accesses
  37. are faster.  
  38.  
  39. You can modify 8 pixels per access for fills with 16 color, and you need
  40. 2 accesses (read-modify-write) for fills that don't access the full byte
  41. of pixels.  Use write mode 3, so you just load the color register once,
  42. then use the pixel mask as the data.
  43.  
  44. For 256 color, use the X mode type of accesses to get access to 4 pixels
  45. at once.  There are a number of techniques to use in this very nonstandard
  46. mode, but you can do fills and masked writes much like 16 color.  This is 
  47. what Michael Abrash's articles discuss.
  48.  
  49. ADirect access speed: I've measured several cards, and the 256-color
  50. access is not very much faster than the 16-color access, taking into
  51. account the algorithmic differenced I discussed above.  Something like
  52. 20% less "stall" on a write access for 256 color, and it's not present
  53. in some cards.
  54.  
  55. As an example: REND386.  Its blitter is twice as fast in 16 color mode as
  56. in 256 color mode.  The 256 color mode uses a varient of X mode, and can
  57. fill 20,000 polygons of 100 pixels each per second.  It can clear a 
  58. 320x200 screen in 20 milliseconds (10 ms with ATI VGA cards).  All
  59. the speeds are twice as fast with 16 color.  Of course, once the rest of
  60. the renderer pipeline is added in, the speed difference between 16 and
  61. 256 color modes is only 25% or so.>
  62. >
  63.  
  64. --------------------------------------------------------------------------
  65. | My life is Hardware,                    |         Dave Stampe          | 
  66. | my destiny is Software,                 | dstampe@psych.toronto.edu    |
  67. | my CPU is Wetware...                    | dstampe@sunee.uwaterloo.ca   | 
  68. | Am I a techno-psychologist, or just an engineer dabbling in psychology?|
  69. ---------------------------------------------------------------------------
  70.  
  71.