SceneView.txt 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. GIZMO TODO:
  2. - Make a C# wrapper for Renderable
  3. - Do I handle it gracefully if user tries to access destroyed component or scene object?
  4. - I don't, at least not with SceneObject. I will try to access HSceneObject handle even if its
  5. destroyed. Add a check.
  6. Refactor GizmoManager and HandleManager so they accept a CameraHandler
  7. Port SceneCameraController to C#
  8. - Will need a C# Cursor and SceneObject C# interface will also likely need to be completed (SceneObject doesn't have Destroy() among other things)
  9. Port RenderTexture to C# and likely extend Texture2D so it accepts renderable flags. While at it add TextureCube and Texture3D as well.
  10. Ensure that EditorWindow resize callback works properly.
  11. - Perhaps add OnResizeEnd callback that can be used for updating the render texture
  12. Create a C# wrapper around ProjectSettings
  13. Make a Script version of SceneEditorWindow
  14. - This would replace SceneEditorWidget so it would initialize scene grid and call
  15. update on handle manager and scene grid, as well as apply ProjectSettings to them.
  16. Move handle is buggy as hell - It moves in wrong direction sometimes, sometimes it skips, other times collision seems to be wrong
  17. Need a way to drag and drop items from Scene tree view to Scene view
  18. When dragging a handle make sure it works when cursor leaves the scene view
  19. Also make sure that handle manager receives mouse up event if its done outside of scene view
  20. AFTER I have scene widget in C#:
  21. - Finish up C# Handles class so it returns proper values
  22. - Ensure fixed handle size and handle snapping works
  23. - Implement free move handle and remaining handles
  24. - Test custom handles from C#
  25. IMPLEMENT SELECTION RENDERING
  26. IMPROVE SceneGrid LOOK
  27. - LIKELY USE PIXEL SceneGrid WITH AA
  28. - OR (better) instead of drawing rows and columns of lines, just draw a plane with procedural texture
  29. LATER:
  30. - Need a way to render text for gizmos and handles, and in scene in general
  31. - Add drag to select
  32. - Need a better system to catch broken shaders. DX11 just draws nothing with depth, DX9 draws all white.
  33. - The bounds I retrieve from GUIUtility are relative to the entire window, not just the current widget. Another reason to move editor widgets to their own GUIWidget.
  34. - Set up Application::getPrimaryViewport so it returns a valid viewport otherwise C# Camera won't work properly
  35. ---------------------------------------------------------------------
  36. Render textures in C#:
  37. - In C# have Texture2D, TextureCube, TextureVolume. They should have a common Texture base.
  38. - Each of those can be created with a Renderable flag
  39. - Render textures mirror what we have in C++
  40. - RenderTexture and MultiRenderTexture (since we have these separate representation we don't need RenderBuffer that Unity has)
  41. - You can provide an existing texture from types listed above, or create a new render target and
  42. create a basic 2D texture (multiple constructors)
  43. - Both RT types should have their color buffer (s) and depth buffer accessible as a texture to be used for rendering, or for reading
  44. ----------------------------------------------------------------------
  45. Handles
  46. SliderLine - position, direction, length
  47. - When initially activated it records position nearest so the line as the starting point
  48. - Further mouse dragging also finds nearest position to the line
  49. - Difference between those two results in a float value (how much to move along direction from position to reach new position)
  50. - Slider line has a capsule + sphere collider size of which can be set manually
  51. SliderPlane - position, normal, size
  52. - Similar to line slider only the direction is determined dynamically as well as distance
  53. - Outputs a Vector2 (direction * distance moved)
  54. - A OOB is used as a collider
  55. SliderDisc - position, normal, radius
  56. - When initially activated it records position nearest so the disc as the starting point
  57. - Further movement calculates the dynamic direction from the starting point to the current point on the plane the disc lies on
  58. - Distance along that direction is returned as amount of movement (similar to line slider)
  59. - Outputs a single float
  60. - A torus is used as a collider
  61. Free move/rotate/scale handles need to exist as well
  62. - Scale is easy, just perform uniform scale. Use SliderPlane oriented towards camera
  63. - Move also use SliderPlane oriented towards camera
  64. - Rotation use SliderDisc oriented towards camera
  65. ----------------------------------------------------
  66. STAGE 1
  67. CONCRETE TODO:
  68. HandleSliderPlane/HandleSliderDisc
  69. - update() implementation
  70. ----------------------------------------------------
  71. STAGE 2
  72. Implement RotateHandle & ScaleHandle in C#
  73. - Nearest point to disc/arc code
  74. Add free move, free rotate, free scale functionality
  75. Handles that remain the same size regardless of distance from camera
  76. - For both drawing and collision
  77. More complex types for drawing like DrawArrow in HandleDrawManager
  78. ----------------------------------------------------------------------
  79. SelectionRenderer
  80. Retrieve a list of selected objects from SelectionManager
  81. Find ones with Renderable components
  82. Retrieve Meshes, and world transforms from them
  83. Draw that same mesh with either a wireframe or a grayed out shader with a slight depth bias
  84. ---------------------------------------------------------------------
  85. Multi-resources
  86. Importer::import
  87. - Each SpecificImporter is responsible for importing all needed resources and registering them with Resources manager
  88. - However only the main resource is returned from that method
  89. - Rest of the resources are referenced by the UUID in ResourceMeta and can be retrieved there if needed
  90. Resources::save
  91. - Add to documentation that it will only save that exact resource and not any dependencies, you must call save() for them manually
  92. Resources::load
  93. - Will automatically load all dependencies, optionally add a boolean that allows you to load only the main asset
  94. ProjectLibrary
  95. - Needs to be extended so it shows sub-resources in tree view
  96. - Need to extend my mapping so one asset maps to multiple assets in library (need to remember how I do that currently, is it just by name or meta-file identifier?)
  97. ---------------------
  98. With this approach I can:
  99. - Reference and load the sub-resources directly
  100. - Technically I can also delete sub-resources