home *** CD-ROM | disk | FTP | other *** search
/ ST-Computer Leser-CD 2000 January / LCD_01_2000.iso / games / doom / pmdoom / doc / gl < prev    next >
Encoding:
Text File  |  1999-12-17  |  6.5 KB  |  150 lines

  1.  
  2. README: glDOOM
  3.  
  4. I never got around to do anything with respect to
  5. a Linux glDOOM port except for assembling a Linux3Dfx
  6. HOWTO (which, at that time, was a prerequisite
  7. to get permission to publicly distribute the
  8. already finished LinuxGlide port by Daryll Strauss).
  9.  
  10. Linux q2test (and soon LinuxQuake2) demonstrate that
  11. Mesa with the MesaVoodoo driver is quite up to the
  12. requirements for a glDOOM port. If anybody wants to
  13. get into Linux glDOOM, please drop me a line.
  14.  
  15. There is a Win32 GLDOOM port in the works, by Jim Dose.
  16. Quoting a recent posting by him:
  17.  
  18. "I haven't had as much time lately to really work on
  19. the conversion. I currently have the renderer drawing
  20. the walls and floors as texture spans as the are in
  21. the software renderer. There's lighting on the walls,
  22. but not the floors, and sprites are being drawn, but
  23. not with the right texture. I figure that this is one
  24. nights work to get the game looking "normal". I haven't
  25. tested the game on less than a p200, so I'm not sure
  26. how it will perform under the average machine, but I
  27. don't expect it to be blindingly fast because of the
  28. number of spans that have to be drawn each frame.
  29. Rendering as polys is definitely the way to go.
  30.  
  31. The reason I chose to do spans first was because it
  32. left the base renderer intact and I could concentrate
  33. on ironing out any Windows compatibility problems.
  34. Actually, the first version I had running was simply
  35. a blit of the 320x200 game screen through Open GL.
  36. Surprisingly, this actually was very playable, but
  37. certainly wasn't taking any advantage of 3D acceleration.
  38. Once the game was running, I started converting all
  39. the span routines over."
  40.  
  41. Comment: for merging Linuxdoom with Win32, this is
  42. probably the best source for getting the Win32
  43. environment done - before more significant changes
  44. occur.
  45.  
  46. "One problem with drawing spans is that the engine
  47. doesn't calculate the texture coordinates with
  48. fractional accuracy, so the bilinear filtering works
  49. vertically, but not horizontally on the walls. I may
  50. try to fix this, but since I plan to use polys for
  51. the final version, it's not really high priority.
  52. Also, spans don't really allow for looking up and
  53. down."
  54.  
  55. Comment: true looking up/down vs. Heretic-style
  56. y-shearing seems to require either a strange kind
  57. of transofrmation matrix (he probably does not use
  58. the OpenGL transformation at all), or rendering
  59. all the spans as textured rectangular slices
  60. instead of using glDrawBitmap. No, polys are the
  61. way to go.
  62.    
  63. "When I tackle the conversion to polys, one big problem
  64. I'll encounter is drawing floors. Since the world is
  65. stored in a 2D bsp tree, there is no information on
  66. the shape of the floors. In fact the floors can be
  67. concave and may include holes (typically, most renderers
  68. break concave polys down into a collection of convex
  69. polys or triangles). In software, the floors are actually
  70. drawn using an algorithm that's similar to a flood fill
  71. (except that a list of open spans is kept instead of a
  72. buffer of pixels).  This makes drawing the floors as
  73. polys fairly difficult."
  74.  
  75. A polygon based approach will require significant changes
  76. to the data structures used in the refresh module. I
  77. recommend either separating a libref_soft.so first (a
  78. Quake2 like approach), and creating libref_gl afterwards,
  79. or abandoning the software rendering entirely.
  80.  
  81. John Carmack wrote once upon a time:
  82. "... the U64 DOOM engine is much more what I would consider
  83. The Right Thing now -- it turns the subsector boundaries
  84. into polygons for the floors and ceilings ahead of time,
  85. then for rendering it walks the BSP front to back, doing
  86. visibility determination of subsectors by the one dimensional
  87. occlusion buffer and clipping sprites into subsectors, then
  88. it goes backwards through the visible subsectors, drawing
  89. floors, ceilings, walls, then sorted internal sprite fragments.
  90. It's a ton simpler and a ton faster, although it does suffer
  91. some overdraw when a high subsector overlooks a low one (but
  92. that is more than made up for by the simplicity of everything
  93. else)."
  94.  
  95. Well, IMO compiling a separate list of floor/ceiling polygons
  96. after having read the WAD file, and thus introducing this as
  97. a completely separate data structure to the current code base
  98. might be the easiest thing to do. Jim Dose writes:
  99.  
  100. "One method I may use to draw the floors as polys was suggested
  101. by Billy Zelsnack of Rebel Boat Rocker when we were working
  102. at 3D Realms together a few years ago. Basically, Billy was
  103. designing an engine that dealt with the world in a 2D portal
  104. format similar to the one that Build used, except that it had
  105. true looking up and down (no shearing). Since floors were
  106. basically implicit and could be concave, Billy drew them as
  107. if the walls extended downwards to infinity, but fixed the
  108. texture coordinates to appear that they were on the plane of
  109. the floor. The effect was that you could look up and down and
  110. there were no gaps or overdraw. It's a fairly clever method
  111. and allows you to store the world in a simpler data format.
  112. Had perspective texture mapping been fast enough back then,
  113. both Build and Doom could have done this in software."
  114.  
  115. Perhaps the above is sufficient to get you started.
  116. Other Issues:
  117.  
  118. 1. Occlusion
  119. DOOM uses a per-column lookup (top/bottom index) to do HLHSR.
  120. This works fine with span based rendering (well, getting
  121. horizontal spans of floors/ceilings into the picture is a
  122. separate story). It isn't really mindboggling with polygon
  123. based rendering. GLDOOM should abandon that.
  124.  
  125. 2. Precalculated Visibility
  126. DOOM has the data used by Quake's PVS - in REJECT.
  127. During Quake development, lots of replacements for the
  128. occlusion buffer were tried, and PVS turned out to be best.
  129. I suggest usind the REJECT as PVS.
  130.  
  131. There have been special effects using a utility named RMB.
  132. REJECT is a lump meant for enemy AI LoS calculation - a
  133. nonstandard REJECT will not work as a PVS, and introduce
  134. rendering errors. I suggest looking for a PVS lump in the
  135. WAD, and using REJECT if none is found. That way, it might
  136. be feasible to eat the cake and keep it.
  137.  
  138. 3. Mipmaps
  139. DOOM does not have mipmapping. As we have 8bit palettized
  140. textures, OpenGL mipmapping might not give the desired
  141. results. Plus, composing textures from patches at runtime
  142. would require runtime mipmapping. Precalculated mipmaps
  143. in the WAD?
  144.  
  145. 4. Sprites
  146. Partly transparent textures and sprites impose another
  147. problem related to mipmapping. Without alpha channel,
  148. this could give strange results. Precalculated, valid
  149. sprite mipmaps (w/o alpha)?
  150.