DX8 Status.txt 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  1. Now we've got WW3D up and running with the skeleton app. Here is a somewhat more detailed/organized
  2. list of what is left to do:
  3. LIMITATIONS/POTENTIAL PROBLEMS:
  4. - Skins need to use a limited set of rendering features?
  5. - Polys going into the alpha system must use a limited set of rendering features.
  6. - Additional procedural material passes cannot be applied to alpha blended meshes (no multi-pass alpha)
  7. - Meshes only get two vertex color arrays. Their vertex materials must be configured properly to enable them.
  8. - HY: Simplescene supports only four global lights
  9. - HY: WW3D Spoltlights have an approximate inverse linear attentuation instead of max linear attentuation
  10. UPDATED TODO LIST:
  11. agg_def:
  12. - Texture replacement feature needs to be implemented
  13. assetmgr:
  14. - Texture cache,
  15. - Dazzle loader,
  16. bmp2d
  17. - works. Code for setting aspect ratio was added but not used due to legacy - HY
  18. boxrobj
  19. - Alpha blending support needed
  20. - Vis rendering code needed
  21. camera
  22. - *** CameraClass projection convention changed to -1<x<1... Fix all code in commando and E&B!
  23. - Also convert all uses of CameraClass::Un_Project!
  24. cullablematpass
  25. - collapsed into matpass
  26. dazzle
  27. - Fully commented out
  28. decalmsh
  29. - works
  30. decalsys
  31. - DistAlphaVP to be converted (renegade)
  32. dx8wrapper
  33. - Toggle_Windowed function commented out
  34. - One-time init functions commented out (TextureLoader,SegmentedLine,Dazzle)
  35. dynamesh
  36. - works except for alpha support
  37. font3d
  38. - works
  39. intersec
  40. - Compiles but not tested,
  41. - Probably contains a lot of un-used functions because all intersect calls are now routing through Cast_Ray!
  42. line3d
  43. - works except for alpha sorting
  44. mapper
  45. - All mappers need to properly handle the u-v array index
  46. - Animating1DMapper commented out
  47. - Axial mapper commented out
  48. - Silhouette mapper commented out
  49. matrixmapper
  50. - All mappers need to properly handle the u-v array index
  51. matinfo
  52. - Texture reduction factor access commented out
  53. matpass
  54. - works except for skins and culling
  55. mesh
  56. - static sort list code commented out
  57. - vis rendering code commented out
  58. - ORIENTED and ALIGNED features broken
  59. - dependencies code commented out
  60. meshmdl
  61. - shadow rendering
  62. - vis rendering
  63. - get_deformed_screenspace_vertices commented out (Can we delete this? skins are working...)
  64. - get_deformed_eyespace_vertices commented out (Can we delete this? skins are working...)
  65. - Render_Prelit
  66. - needs to use the dynamic index buffer when rendering cullable material passes
  67. meshmdlio
  68. - animated texture loading not implemented
  69. - use mesh TWOSIDED flag to set shaders on loading (and take out Jani's temp code to do this on the fly)
  70. metalmap
  71. - fully commented out
  72. pointgr
  73. - works except for alpha support
  74. r3dobj
  75. - fully commented out - may be able to DELETE
  76. render2d
  77. - works
  78. rendobj
  79. - texture_reduction feature commented out - may not be needed (only have a global texture reduction factor?)
  80. rinfo
  81. - surrender-specific vis code
  82. ringobj
  83. - works
  84. - no alpha support
  85. - vis rendering code commented out
  86. scene
  87. - static sort list code commented out
  88. segline
  89. - material handling code commented out
  90. - rendering code commented out
  91. shattersystem
  92. - works, but might not for multi-texturing.
  93. - Naty check if dynamesh supports multi-texturing. you changed the interface
  94. - a bit. HY
  95. sphereobj
  96. - works
  97. - no alpha support
  98. - no viz
  99. - might have bug in sphere generation when sphere is too big
  100. sr_util
  101. - DELETED!
  102. statistics
  103. - fully commented out
  104. texfcach
  105. - fully commented out
  106. texproject
  107. - works except for the second stage stuff (is this generally broken?).
  108. textdraw
  109. - works. This is a legacy font system to be removed from Renegade.
  110. texture
  111. - lots of miscellaneous missing features here
  112. - NoLOD flag to be supported for UI textures
  113. texturefile
  114. - fully commented out
  115. textureloader
  116. - fully commented out, this is the background loading system
  117. txt.cpp
  118. - works. This is a legacy font system to be removed from E&B.
  119. txt2d.cpp
  120. - works. This is a legacy font system to be removed from E&B.
  121. vertmaterial
  122. - all uses of VertexMaterialClass may need to configure the UV-array source index.
  123. - all users of VMC must properly enable/disable lighting
  124. - all users of VMC must configure the diffuse and emissive color source if they want per-vertex arrays...
  125. - changed so the default is visible - HY
  126. - TODO: Make Get_Preset const so no one can modify the static presets
  127. ww3d
  128. - TextureLoader support commented out of Begin_Render
  129. - Statistics code commented out
  130. - Read_Gerd_Render_Device_Description commented out (?)
  131. - Set/Get_Texture_Reduction commented out
  132. - Flush_Texture_Cache function commented out
  133. - Detect_Drivers commented out
  134. - On_Activate/Deactivate_App commented out
  135. - Update_Pixel_Center commented out
  136. General:
  137. - Add support for multiple texture stages
  138. - Create sort system
  139. - Add support for exclusion masks. The way this works is that we support exclusion masks differently at the top-level object level and the low-level rendering object level (note that this means that the mid-levels will get skipped over unless we collapse the container bits together with the low-level object bits. However we probably cannot do this, since the subobjects bits may be more permissive than the container's bits. Should we worry about this?). At the top level, when the light environment is constructed, we filter the light's exclusion bits vs. the light environments' exclusion bits (passed into the construct call, stored in the light environment at creation, or something). If it does not pass, it is not inserted into the light environment. When we insert a light into the light environment, we also store its exclusion bits (perhaps we only do this if "light aggregation" is turned off - see below). Then the low-level code for applying the current light environment receives the low-level robj's exclusion bits, compares them, and decides whether to actually set the light into D3D. For this to work properly, we need a flag to prevent lights which are rejected from the light environment because it is full of more-important lights from contributing to the ambient.
  140. - Change the "Get_Texture_Array" functions in MeshMatDescClass to private, change name to PEEK!
  141. - have texture category sorting functions take account of both texture stages
  142. NOTE: We have three enums/#defines/consts for the number of texture stages:
  143. RENDERER_MAX_TEX_STAGES, MeshMatDescClass::MAX_TEX_STAGES, MeshBuilderClass::MAX_STAGES.
  144. We are even explicitly comparing two of them and asserting if they are different in
  145. dx8renderer.cpp. There is a similar situation with DX8FVFCategoryContainer::MAX_PASSES,
  146. MeshMatDescClass::MAX_PASSES and MeshBuilderClass::MAX_PASSES. We need to clean this up!
  147. Features we are removing support for (will need application changes):
  148. - indirect textures (we will provide a (slow) function to swap textures)
  149. Ok, the WW3D2 skeleton program compiles and links now with no references to SR. Some files I took more care on, others I blocked out the entire file for later. Every piece of code is wrapped with #ifdef WW3D_DX8 with a matching #endif and comment, there should be no typo's in the #ifdef's because I used a macro to insert them all (so we can do searches and safely assume that we see all of them).
  150. Here are some (raw) notes I took while commenting out all references to SR:
  151. X - VertexMaterialClass - need to separate from sr (SOON)
  152. X - Basic texture functionality (loading from files, etc)
  153. - More advanced texture handling code needs to be re-implemented, but try to maintain our current interfaces as much as possible. Many issues here: background thread loader, texture file cache, texture LOD, indirect textures ?... (SOON)
  154. X - ShaderClass - just convert to our own, mimicing the bitfield that SR used for now (SOON)
  155. - Exclusion masks - this is not supported but some application code is probably using it. We need to decide what to do here.
  156. - Camera aligned and camera oriented meshes - the way we used to do them required the mesh push transform code to change the camera matrix, which doesn't work well with our current scheme. We need to think how to support this stuff.
  157. X - MaterialInfo Class - can un-comment when we have the above material systems in place, evaluate where this is used?
  158. - sr_util - all of these functions un-needed? (no more As_srVector3 :-)
  159. - agg_def.cpp - all texture features commented out
  160. X - box render objects completely commented out - materials, gerd
  161. - texturefcache - commented out
  162. - TextureFileClass - commented out
  163. X - DynaMeshClass - commented out, need materials, gerd replacement, new rendering interface before we can bring this back. A *lot* of stuff uses DynaMeshClass... (shatter system, text systems, etc)
  164. - Dazzles - commented out, gerd, materials
  165. - streaming textures - commented out, new texture code needed
  166. - texture creation functions in assetmanager commented out
  167. X - Bitmap2DObjClass - commented out, do we need this any more? - depends on dynamesh
  168. X - BW Render, used for shadow rendering, uses some srVectorProcessor stuff
  169. X - Camera - internals commented out
  170. X - MatPass, CullableMatPass - all procedural material passes commented out, design new, low-level rendering interface, then port these to it.
  171. X - passdata.h - no sure what this is for, it is commented out
  172. X - meshmodel - all material functions commented out, will also probably re-write the guts of meshmodel to store "sub-meshes" rather than material arrays. depends on design of new low-level rendering system. (SOON)
  173. X - decal system - all material handling commented out, rendering commented out, depends on new low-level rendering system
  174. X - matrix mapper - this is used to generate u-v coordinates in a surrender vertex processor, new system needs to support this functionality, then we can port this (well, it will use DX8 features to do the same thing in HW...)
  175. X - intersec.h - commented out, Eric Cosky's collision code, do we need this any more?
  176. X - dx8renderer - uses srVectorProcessor
  177. X - dx8wrapper - uses Gerd
  178. X - fog.cpp - all fog objects commented out, probably won't implement fog with a render object, just have fog settings be stored in the scene
  179. X - font3d - surface loading! textures
  180. X - lightclass - hmmmm, re-consider lighting...
  181. X - lightenv - uses lightclass as input.
  182. X - line3d - uses srModeller, srMeshModel. Do we need this any more?
  183. X - mapper.cpp - srVertexProcessor, need to convert to HW form (DELETED)
  184. X - mesh - materials, gerd transforms, meshmodel
  185. X - meshgeometry - uses srVectorProcessor in a couple of places
  186. X - meshmdl - lots of material and gerd stuff, re-design?
  187. - metalmap - uses vectorprocessor, textures
  188. X - pointgroups - surrender types, gerd rendering, materials
  189. X - particle buffer - needs point group
  190. X - particle emitter - materials, particle buffer
  191. X - particle loader - needs particle classes, materials
  192. X - polyinfo - don't know what this is?
  193. X - projector - built on top of matrix mapper, used for projected textures
  194. X - r3dobj - image3dobj, can we delete this?
  195. X - render2d - textures, gerd calls
  196. X - rendertype - lots of GERD stuff, Jani is this an "obsolete" optimization?
  197. - rinfo - material passes, gerd stuff, vis commands which use ext-functions for the surrender software rasterizer.
  198. X - ring render object - materials, gerd rendering calls
  199. X - scene - fog settings, don't use FogClass any more, just plug fog settings into the new low-level interface...
  200. - scene - ensure that the scene ambient light value gets added into the light environment's effective ambient (E&B uses the scene ambient and currently it doesn't do anything)
  201. - segline - custom gerd pipeline, materials
  202. X - shatter system - dynamic meshes, materials.
  203. X - sphere - materials, gerd rendering calls
  204. - statistics - Jani's texture stats, new texture system must support this.
  205. - texfcache - completely commented out
  206. X - texproject - needs procedural material pass interface, vertex processor...
  207. X - textdraw - textures, dynamic meshes
  208. - texture loader - is this the backround thread loader? commented out
  209. X - txt.cpp - uses textures
  210. X - txt2d.cpp - uses txt, dynameshes
  211. X - vertexbuffer.cpp - not sure what this is, uses srVectorProcessor
  212. - ww3d - lots of gerd calls, surrender types, screen capture, movie capture, texture reduction, statistics
  213. - Investigate cost of BeginScene-EndScene, set viewport has to occur right after beginScene... Should we minimize our viewport changes? If the cost is high, we might need to separate the viewport definition from the camera...
  214. - Silhouette mapper un-implemented
  215. - Axial mapper un-implemented
  216. - How should handle the extra render states for dealing with TexGen? If we apply these states, there is nothing to remove them!
  217. -- HY render states for texgen and texmaterial are encapsulated in vertex material & mapper
  218. -- if the vertex material detects a null mapper the defaults are set.
  219. - Make Dynamesh support Cast_Ray so that the E&B intersection code works!
  220. Shaders have been converted to Shader->Apply() and the state is being tracked by the shader class.
  221. Materials have been converted to Material->Apply() which calls Mapper->Apply()
  222. Now, some big issues we need to think about are (in no particular order):
  223. SOME GOALS - Maintain as many existing class interfaces as we can so that our apps don't have much re-coding!
  224. Input data is existing W3D files, no format changes or new tools! (for now anyway :-)
  225. Incorporate the ideas in Jani's DX8 code, grouping small meshes together in larger VBs, etc
  226. GERD Replacement - our new low-level rendering interface needs to be the replacement for everywhere we are using the GERD. It needs to supply all of the features that we are using in the GERD currently while allowing us to use Jani's mesh optimizations. There is a lot to think about here and almost everything depends on us doing this right. It also might need to serve as an abstraction layer so that I can implement a software VIS-renderer behind it.
  227. SOLUTION: No GERD replacement, no abstraction layer. DX8Wrapper will be a thin insulation layer though.
  228. VIS - I'll have to re-implement the rendering code for VIS. It will be a 32bit, solid fill, zbuffering software rasterizer. Not too hard but still a bit of work. Needs to be done in a way that all render objects can be rendered through it easily.
  229. SOLUTION: Vis rendering will branch at the render object level to a new custom vis rasterizer possibly based on the bw shadow code
  230. TEXTURES - there are many features in the textures system, the "file cache", background loading, LOD, tga loading, global texture reduction factor, etc.
  231. SOLUTION: Naty is working on this system.
  232. MESHMODEL - I think we'll need to do some load-time conversion of all of our mesh-models into a form similar to Jani's dx8 mesh code. More thought needs to be put into this.
  233. ALPHA SORTING - This issue becomes especially complex when you think about mixing different types of render objects. This issue will influence how we design the low level rendering interface.
  234. SOLUTION: There will be a custom alpha sorting/rendering system. RenderObjects will be allowed to talk to either DX8 or this system.
  235. UNIX - It looks like Neal has put some effort into making ww3d compile under Unix. We will probably make life very difficult for him if there are DX8 calls all over the place :-)
  236. SOLUTION: UNIX version of E&B will not use WW3D2. It only needs collision detection so we'll implement a custom solution.
  237. Optimizations:
  238. ==============
  239. * Currently we search a linear list for textures with the same name every time we ask
  240. the asset manager for a new texture. We should probably use the hashtable template
  241. for this instead.
  242. * The VectorProcessorClass stuff is completely unoptimized - we might want to
  243. optimize this in future.
  244. ********* NEW STUFF ************
  245. DX8 Features which we currently do not support and might want to in future:
  246. * Different modes than clamp and wrap - DX8 exposes all kinds of cool modes like mirror, mirror once - do we expose these in our tools? How well are they supported in hardware? If they are not universally supported then we probably don't want to expose them...
  247. * Cube and volume textures - support via inheriting from shared base class with TextureClass?
  248. * Anisotropic filtering: currently trilinear is enabled in the TextureClass but not in our tools. There are issues to think about for both trilinear and anisotropic like: not all hardware supports it, some hardware supports it if there is just one texture but not otherwise, or with a slowdown etc. - this is probably not something we want the artist to specify directly: perhaps the artist can mark those meshes which would benefit from "advanced filtering", and we turn it on selectively depending on hardware?
  249. We can do fancy texture matrix operations "for free" now. (Only on Hardware T&L cards!)