home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sys / atari / st / 18910 < prev    next >
Encoding:
Text File  |  1992-12-24  |  4.9 KB  |  99 lines

  1. Newsgroups: comp.sys.atari.st
  2. Path: sparky!uunet!stanford.edu!nntp.Stanford.EDU!geomorph
  3. From: geomorph@leland.Stanford.EDU (Bayard Wenzel)
  4. Subject: Re: Apology:  True Colour *IS* great for games.
  5. Message-ID: <1992Dec24.211748.28603@leland.Stanford.EDU>
  6. Followup-To: Article 32399
  7. Sender: ?@leland.Stanford.EDU
  8. Organization: DSG, Stanford University, CA 94305, USA
  9. References: <11490@uqcspe.cs.uq.oz.au> <1992Dec24.053556.20186@leland.Stanford.EDU> <711@muller.loria.fr>
  10. Date: Thu, 24 Dec 92 21:17:48 GMT
  11. Lines: 86
  12.  
  13. eker@loria.fr (Steven Eker) writes in article <1992Dec24.053556.20186@leland.Stanford.EDU>:
  14.  
  15. >In article <1992Dec24.053556.20186@leland.Stanford.EDU>, geomorph@leland.Stanford.EDU (Bayard Wenzel) writes:
  16. >|>[My article on True Color an 3D Graphics deleted]
  17. >
  18. >Not if you choose the positions of your colours in the palette to work for you
  19. >rather than against you - with smart allocation scheme it can be faster.
  20.  
  21. If you already have the True Color value of the pixel, converting to 256 colors
  22. will require at least 3 divisions (make them shifts if you want and can) and
  23. two ORs when using the 6R 7G 6B color distribution. I think this is one of
  24. the best distributions when using polygon graphics with lots of colors since it
  25. looks to me (I'm not sure about this part) that it's one of the fastest.
  26. But suppose that you found a faster algorythm, and suppose it only
  27. requires one or two extra instructions besides the move to memory. It still is
  28. slower since you can directly move the True Color word to memory. And remember
  29. it takes the same time to move a word and a byte.
  30.  
  31.  
  32. >|> [More stuff I wrote deleted]
  33. >
  34. >The good thing about true color is that it is 1word/pixel layout in memory
  35. >rather than interleaved bit planes.Thus you can set the colour of a pixel with
  36. >1 access rather than 16. With flat shading this isn't so important since you
  37. >can write 16 consectutive pixels with the same colour.With gouraud shading the
  38. >value of each pixel is calculated individually and it makes a big difference.
  39. >
  40. >256 colour palette with 1byte/pixel would be much faster for shading and texture
  41. >mapping but unfortunately 256 color modes use interleaved bit planes on the
  42. >falcon.
  43. >
  44. >It _might_ be possible to do real time gouraud shading and even texture mapping
  45. >in true color mode if the bus is fast/smart enough.
  46.  
  47. Once more I say it takes the same time to write a byte or a word in a bus
  48. bigger than 16 bits so if the bus is not fast enough to do it in True Color
  49. then it can't do it in 256 color mode either. I didn't know the Falcon used
  50. interleaved bits for 256 color. This is rather sad since it may take more time
  51. to draw the screen in some cases(like using 8x8 sprites).
  52.  
  53. >|> [More stuff I wrote deleted]
  54. >
  55. >The DSP<->main memory bus is unlikely to be fast enough for the DSP to do shading.
  56. >The trick is to have the DSP do all the 3D/lighting calculations/facet
  57. >sorting/clipping at polygon level so that the 68030 can spend ~90% of its
  58. >time rendering polygons
  59. >- ideally with a tight (<=128 byte) inner loop so that it gets most of its
  60. >instructions from cache to avoid bus contention.
  61.  
  62. That's what I meant when I said "specially with the DSP". The DSP can be used
  63. for vector transformations and ligting calcs. while the 68030 draws the
  64. polygons.
  65.  
  66. >Suppose 6byte/vertex (16bit x, y, color) and average of 6 vertices/polygon.
  67. >At 30fps with say 500 polygons on screen we need ~540K/s DSP->main memory.
  68. >Assuming the world is stored in DSP RAM the main memory->DSP transfers will
  69. >only contain position updates for moving objects. Just about doable...
  70. >but only just.
  71. >
  72. >Its the speed of the 68030 and the 68030<->main memory bandwidth that worries me.
  73.  
  74. I think the 68030<-> is fast enough. I imagine it's a lot faster than an ISA
  75. bus on the PC. The latest flight sims on the PC use gouraud shading on some
  76. objects like polygons and stuff. I'm sure that the update is not even 30 frames
  77. per second on those games but it is fast enough to be acceptable.
  78.  
  79. >Even with the best algorithms and coding tricks I doubt you can render even a
  80. >small gouraud polygon in ~300 instructions... but maybe its possible to find
  81. >a neat way of preprocessing the polygon on the DSP (eg y-sorting verticies,
  82. >precomputing Bresenham increments for each edge) to speed things up; or do
  83. >something clever with the blitter.
  84. >
  85. >Steven
  86.  
  87. I was thinking somewhat along the same lines you are. The world should be
  88. stored in DSP memory. The DSP should be constantly transforming polygons and
  89. calculating the lighting for them. It can get two requests from a 68030, either
  90. change camera coordinates in which case it clears the buffer and starts
  91. recalculating, or get the next polygon to be rendered (already sorted).
  92. When it returns a polygon it returns the the vertices (4 bytes each, 2 for x &
  93. 2 for y) and the plane equation coefficients for calculating the color at each
  94. point in the polygon. The 68030 would then calculate the polygon and the colors
  95. using the standard techniques coded for maximum perf. of course.
  96.  
  97. Sebastian Ferreyra
  98.  
  99.