TODO.txt 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. ----------------------- CAMELOT 2D / GUI -----------------------------------------------------------
  2. ----------------------------------------------------------------------------------------------
  3. When I'm canceling command queue commands I might be canceling important user commands.
  4. - (e.g. user schedules a resource update and I cancel the command)
  5. - render commands can be cancelled with no repercussions?
  6. - maybe I should someone block sim thread if its running too fast?
  7. - input lag?
  8. --------
  9. DebugDraw
  10. - DebugDraw support for AA lines
  11. - Add DX9 and GL debug draw shaders
  12. I still re-create GUIWidget mesh every frame instead of just updating it.
  13. MAJOR ISSUE: writeSubresource/readSubresoure doesn't require a shared ptr to GpuResourceData which means it could get destroyed while still in command queue. Right now it only works because I block right after I call those methods, which ensures nothing is destroyed.
  14. - When fixed, make sure I remove blocking calls after writeSubresource where they're not needed (GUIManager for example)
  15. I call waitUntilLoaded too many times. Sometimes 5-6 times in a single function. Each of those calls will wait a single frame.
  16. GUIWidget::updateMeshes leaks. If I leave the game running I can see memory continously going up
  17. IMMEDIATE:
  18. - Add window-management command to DeferredRenderContext - I already have resource management commands
  19. there, few window related ones won't hurt. I can always split the class if needed.
  20. - Possibly add guards to render target classes so they aren't accidentaly accessed from the render thread (similar to how Texture is handled)
  21. - I have disabled linear filtering because it doesn't look good on scale9grid textures. (Add another material so it works with stretched textures?)
  22. - Enable alpha test so I don't render completely transparent pixels.
  23. - What happens when I don't set a texture for a state of a GUI element. Use a dummy white texture probably?
  24. - Make sure GUI system uses a dummy texture if one isn't available
  25. - SpriteTexture keeps a static reference to DUmmyTexture which I need to release before shutdown
  26. TextBox needed elements:
  27. - Render element: background texture and a text sprite
  28. - Keyboard focus: Mouse click gives focus, tabbing between elements gives focus (TODO: explore how will tabbing work)
  29. - Input: All characters get forwarded to element with focus
  30. - Input cursor - Mouse click within box moves input, arrow keys move input. If cursor goes out of clip limits, move text.
  31. - CURSOR needs to flash. Implement it as a GUIManager::showInputCursor(depth, position) method instead of doing it in GUITextBox.
  32. - Text selection - Shift + arrow keys select text. Mouse drag selects text, and scrolls the text if needed. Text selection is drawn using another single color image sprite. Selection height is determined by line height.
  33. - Text operations - Select all, copy, paste (using shorcuts, possibly also context menu?)
  34. - Make sure multi-line text boxes work fine as well.
  35. Window needed systems:
  36. EditorWindowContainer
  37. - TabbedTitleBar widget
  38. - contains minimize/maximize/close buttons
  39. - contains window toggle buttons, and in between them invisible buttons that serve as drag drop points and for moving the window
  40. - dragging the in-between button will cause the window to move
  41. - droping another window will cause the window to be docked at that location
  42. - dragging the window toggle button will cause the window to undock. (or if the window is already undocked and is the only one in the titlebar, it will cause the window to move)
  43. - contains title bar background
  44. - Window frame
  45. - contains tiled window background
  46. - contains scale9grid frame
  47. - frame allows for resize
  48. - frame changes color when window is in focus
  49. - Contents
  50. - Actual Editor Window with custom contents
  51. GUIDragManager
  52. - GUI system sends startdrag/enddrag/drag events to all elements
  53. - startDrag(void* userPtr) changes cursor
  54. - releasing the cursor sends enddrag event and then the control can retrieve the user ptr
  55. -----------
  56. I need to be able to provide smaller bounds used for UI input
  57. - Add padding - reduces the size of the element and that is used for input
  58. - Add margins - spacing that is added when laying out multiple controls after each other
  59. Figure out how to deal with callbacks properly. I recently eliminated them from Input but I'll need them for my GUI elements...
  60. - How do I implement them? I really don't want to do Unitys approach to GUI
  61. - If I do figure out a good way to keep callbacks, maybe rethink Input and re-add them?
  62. - My test model is rendering back faces. I need to flip them.
  63. - Although more than likely I am loading the model incorrectly since it works in Unity?
  64. - I probably want to determine front faces based on normals
  65. Immediate TODO:
  66. - A way to handle onMouseOver, onMouseOut, onMouseDown, onMouseUp events
  67. - (optional) Implement DirectDraw for drawing the bounds so I know they're correct
  68. - A way to update mesh buffers without recreating vertex/index buffers (Setting data currently does exactly that)
  69. ------------------------------------------------------------------------------------------------
  70. Longterm plans:
  71. <<Multithreaded GUI rendering>>
  72. - Event handling and normal "update" will still be done on the main thread
  73. - At the beginning of each frame a GUI mesh update is queued on the GUI thread
  74. - Since we're queuing the update at the beggining of the frame we will be using last frames transform and gui element states.
  75. - When queing we need to make sure to store GUIWidget transform, and specific element states (e.g. "text" in GUILabel)
  76. - At the end of simulation frame wait until GUI update is complete. After both simulation and GUI updates are complete, proceed with submitting it to render system.
  77. <<Figure out how to store texture references in a font>>
  78. - Currently I store a copy of the textures but how do I automatically update the font if they change?
  79. - Flesh out the dependencies system?
  80. - I can import texture as normal, and keep it as an actual TextureHandle, only keep it hidden
  81. if it was created automatically (by FontImporter) for example?
  82. - But then who deletes the texture?
  83. - Set up an "internalResource" system where resources hold references to each other and also release them?
  84. - In inspector they can be expanded as children of the main resource, but cannot be directly modified?
  85. - Deleting the main resource deletes the children too
  86. <<Window controls>>
  87. - Create GUIWindowFrame/GUITitleBar control that can be added to the widget
  88. - it has onMaximize, onMinimize, onClose, onMove, onResize callbacks
  89. - when window is floating onMove/onResize will resize the actual Window
  90. - when docked (EditorWindow should know if it's docked or not) it will call back the layout manager
  91. - (Frame and title bar need to be separate as some windows will used tabbed bar instead of normal title bar)
  92. - GUITabbedArea that will serve for tabbed EditorWindows
  93. - GUITabArea allows you to move tabs around, but also dock/undock them if the user drags the tab outside.
  94. - MainEditorWindow - handled specially, no need for a good interface
  95. - Keeps a title bar, status bar and a layout manager (i.e. docking manager)
  96. <<MessageBox class>>
  97. - A good first test case for my GUI windows
  98. <<Other>>
  99. - GUIManager events
  100. - GUIElement and GUIWidget "hasFocus" flag
  101. - Only elements in focus receive keyboard events
  102. - There is an issue that custom-UIs won't have their mesh shared. For example most game UIs will be advanced and will
  103. likely use on GUIWidget per element. However currently I only perform batching within a single widget which
  104. doesn't help in the mentioned case.
  105. ----------------------------------------------------------------------------------------------
  106. Other:
  107. - Move Debug to CamelotCore and add SetFillMode
  108. -----------------------BACKLOG TODO---------------------------------------------------------------
  109. ----------------------------------------------------------------------------------------------
  110. High priority:
  111. - GetRenderOperation doesn't consider sub-meshes
  112. ----------------------------------------------------------------------------------------------
  113. Medium priority:
  114. - Add a field that tracks % of resource deserialization in BinarySerializer
  115. - Mesh loading:
  116. - Example Freefall mesh has one index per vertex, and there are 17k+ vertices. I think I need a post-process step that optimizes them.
  117. - Imported FBX meshes are too big
  118. - Ogre performed special DDS loading. I removed that. I'm not sure if I'll need to re-add it?
  119. - My log is not thread safe yet it is being called from multiple threads.
  120. - RTTI:
  121. When defining RTTIType like so:
  122. RTTIType<D3D9HLSLProgram, HighLevelGpuProgram, D3D9HLSLProgramRTTI>
  123. I need to make sure that HighLevelGpuProgram class has valid RTTI type as well. Otherwise the inheritance hierarchy will not be correct. Right now this isn't checked anywhere.
  124. - Make sure that I am able to blit contents from render textures on all render systems
  125. - Command buffer:
  126. - Make CommandQueue not use mutexes and use atomics instead??
  127. - Figure out how to handle accessing texture from a non-render thread?
  128. - When importing a resource, and registering it with Resources I don't think it properly gets added to the loaded resources array? For some reason shaders get created twice.
  129. - Doing setPixels_async in the texture doesn't make sure that the user doesn't actually modify the provided PixelData after that call.
  130. - In general I need to rethink how to handle modifying resources with multithreading
  131. - Closing down a window (any window) will shut down main rendering loop
  132. ----------------------------------------------------------------------------------------------
  133. Low priority TODO
  134. - Mesh loading:
  135. - Sub-meshes aren't being transformed by world matrices of their nodes
  136. - Remove template from RTTIType and move it to IReflectable? This way i can hopefully move GetRTTITypeStatic and GetRTTIType to IReflectable so I don't
  137. need to manually implement those for every method.
  138. - Viewport needs to be updated when I call RenderTarget::setFullscreen/finishSwitchingFullscreen/updateWindowRect/windowMovedOrResized. Currently it's not
  139. - D3D9Texture::createTextureResources is commented out at the moment. It gets called on device reset, and at that point I should reload texture resources.
  140. - I should probably keep all resources by DX managed. OpenGL apparently keeps a mirror of all its resources anyway.
  141. - Device reset and resource re-loading in general
  142. - Fix up WorkQueue as it doesn't lock when initializing, to make sure threads are actually started before returning
  143. - CPU reading or writing to a render texture in OpenGL is not supported. (CmGLHardwarePixelBuffer::upload/download).
  144. - When saving a resource, make sure resource is properly loaded before saving
  145. - Add doc to Resources::save that says it will block until render thread updates the resource
  146. - Add documentation that tells the user that reading a resource non-async will block the thread and execute all queued render commands first
  147. - Remove Response handlers from Resources
  148. - Cg doesn't work. Either remove it or get it to work
  149. - System is not yet ready for multiple rendering contexts
  150. - When serializing/deserializing derived classes, deserialization is done from most derived to base, while it should probably be done the other way around.
  151. - Because GLSL introspection API is built around basic types I don't support structs or arrays of objects:
  152. - I can't determine the size of struct or object arrays, as GL compiler will optimize out unused elements
  153. - Can't determine size of individual struct either, for the same reason (some struct members might get optimized out)
  154. - Arrays of objects aren't supported in HLSL or GLSL because of limited GLSL introspection
  155. - I might need to add an exception thrown if user tries to use them
  156. - Structs aren't supported in GLSL for introspection reasons
  157. - Go through pixel formats and removed unused ones: L8, L16, A4L4, and many others
  158. - Having shared_ptrs used in RenderSystem and CommandQueue can cause potential performance problems. Dozends of thousands of shared
  159. pointers may be getting queued in command queue per frame, in a slightly more complex scene, which will most certainly cause performance problems
  160. due to thread safety and atomics used by shared_ptr. However I still need some guarantee that objects queued in RenderSystem won't be destroyed
  161. by the sim. thread.
  162. - A way to bind buffers to a Pass, while specifying buffer range
  163. - Add GL Texture buffers (They're equivalent to DX11 buffers) - http://www.opengl.org/wiki/Buffer_Texture
  164. - Better creation of PrimaryWindow
  165. - RENDERWINDOWDESC accepts a "externalWindow" flag and an "externalHandle" so when creating the primary window with RenderSystem::initialize we don't always need to create a new window
  166. - Actually new OpenGL seems to support creating context without a window with the help of wglCreateContextAttribsARB and wglMakeCurrent:
  167. - OpenGL render window no longer looks for a monitor index
  168. - Material RTTI should also serialize shared buffers (they need to be made into a resource)
  169. - BE CAREFUL on how this will be implemented. Likely it will have much of the same interface as a material and/or GpuParams
  170. - Mesh::setMeshData is currently always synced
  171. - queueGpuCommand is handled weird. shared_ptr isn't used for setting (this) parameter, and could be optimized out by the compiler
  172. - test if everything is okay in release mode
  173. - Resources::unload will deadlock if the resource isn't being loaded!
  174. - Maybe re-think how I handle ResourceHandle.isCreated?
  175. - Check D3D9/D3D11/GL resource usages. DX11 reports many unreleased objects. I'm guessing DX9 will as well. Not sure how to check OpenGL.
  176. - Shared GPU buffers
  177. - wouldn't work atm due to the way I update the buffers (and the way I mark them dirty)
  178. - Material::setParamBlock is commented out
  179. ----------------------------------------------------------------------------------------------
  180. Optional:
  181. - Need better handling for shader techniques. Some Materials are able to run on all renderers yet I can only specify one. This is problematic
  182. for Materials for things like text and sprites, which should run on all renderers, even if user adds a new one
  183. - Add precompiled headers to all projects
  184. - If possible, make sure GLSL uses EntryPoint and Profile fields I have added to GpuProgram
  185. - Move all x86 libs to x86 folders. Move all binaries to x86 folders as well
  186. - Serializable callbacks can't be null otherwise compiler complains
  187. - FBX importer can be greatly sped up by implementing a better allocator
  188. - Extend texture copy so it accepts different subregions & subresources (currently only entire resource can be copied)
  189. - Need a way to convert MSAA render texture into a normal render texture
  190. - Vertex buffer start offset is not supported when calling Draw methods
  191. - Instead of doing setThisPtr on every CoreGpuObject, use intrusive shared_ptr instead?
  192. - Renderer::render(CameraPtr) is currently commented out because I moved Camera out of Camelot and I didn't want to bother figuring how to port this
  193. - When rendering Scale9Grid GUI elements the stretched center will cause linear interpolation to kick in and blend the edges with the border parts of the texture.
  194. - I should use point filtering for scale9grid, but that doesn't work in general case for stretched textures as they would look bad
  195. ----------------------------------------------------------------------------------------------
  196. After polish and ideas:
  197. - Each view (i.e. camera) of the scene should be put into its own thread
  198. - How do I handle multiple mesh formats? Some files need animation, other don't. Some would mabye like to use QTangent, others the proper tangent frame.
  199. - Asset postprocessor? Imports a regular mesh using normal importers and then postprocesses it into a specialized format?
  200. - Load texture mips separately so we can unload HQ textures from far away objects (like UE3)
  201. - Add Unified shader so I can easily switch between HLSL and GLSL shaders (they need same parameters usually, just different code)
  202. - Maybe just add support for Cg and force everyone to use that? - I'd like to be able to just switch out renderer in a single location and that everything keeps on working without
  203. further modifications.
  204. - Port boost threads to std threads (CmThreadDefines.h)
  205. - Remove HardwarePixelBuffer (DX11 doesn't use it, and DX9 and OpenGL textures can be rewritten so they have its methods internally)
  206. - Multihead device
  207. - 3D rendering (use low level hardware methods for it)
  208. - Don't forget to check out Unity DX11 documentation on how to implement DX11 features (http://docs.unity3d.com/Documentation/Manual/DirectX11.html)
  209. - Go to Game Engine Architecture book and make a list of Utility systems we will need (Config files, Parsers, File I/O etc)
  210. - Go to GEA book and read about resource managers before implementing them
  211. - Actually I should re-read most of the chapers in the book, or all of it
  212. - When building internal GUI make sure to use CEGUI as a reference
  213. - OpenGL non-Win32 window files haven't been properly parsed or tested
  214. - Since I probably can't compile them, try adding them to VS and see what intellisense says?
  215. - Textures and all other buffers keep a copy of their data in system memory. If there are memory constraints we might need a way to avoid this.
  216. - Move all multiplatform files (window creation, cursor, etc.) into a separate PlatformSpecific folder. So anyone porting it to a new platform
  217. knows that he only needs to change those files.