SceneView.txt 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. GIZMO TODO:
  2. - Make a C# wrapper for Camera and Renderable
  3. 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.
  4. Hook up Input callbacks in ScriptInput
  5. Passing a Vector2I (and I'm assuming any script) through a thunk crashes the runtime
  6. Set up Application::getPrimaryViewport so it returns a valid viewport otherwise C# Camera won't work properly
  7. REFACTOR material getParams* and related classes. Those params should update all gpu program params that share that variable, not just the first found
  8. Need a way to drag and drop items from Scene tree view to Scene view
  9. When dragging a handle make sure it works when cursor leaves the scene view
  10. Also make sure that handle manager receives mouse up event if its done outside of scene view
  11. When selecting/deselecting stuff handle display is delayed
  12. Create the scene widget completely in C#?
  13. - Port Camera/viewport, RenderTexture, SceneCameraController, Input, ProjectSettings, SceneGrid
  14. - Will need to track when widget resizes so I can resize the render target
  15. - Handle manager update will originate from the widget
  16. - Actually it could still be done from C++
  17. - How will scene grid rendering be handled? Currently it's done from a render() callback
  18. - It's still going to have a C++ representation, just call the callback there
  19. - I will still need a C++ version of scene widget (not in script code but in editor code) because handle/gizmo manager reference it
  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. ---------------------------------------------------------------------
  34. Render textures in C#:
  35. - In C# have Texture2D, TextureCube, TextureVolume, Texture2DArray. They should have a common Texture base.
  36. - Each of those can be created with a Renderable flag
  37. - Render textures mirror what we have in C++
  38. - RenderTexture and MultiRenderTexture (since we have these separate representation we don't need RenderBuffer that Unity has)
  39. - You can provide an existing texture from types listed above, or create a new render target and
  40. create a basic 2D texture (multiple constructors)
  41. - Both RT types should have their color buffer (s) and depth buffer accessible as a texture to be used for rendering, or for reading
  42. ----------------------------------------------------------------------
  43. Handles
  44. SliderLine - position, direction, length
  45. - When initially activated it records position nearest so the line as the starting point
  46. - Further mouse dragging also finds nearest position to the line
  47. - Difference between those two results in a float value (how much to move along direction from position to reach new position)
  48. - Slider line has a capsule + sphere collider size of which can be set manually
  49. SliderPlane - position, normal, size
  50. - Similar to line slider only the direction is determined dynamically as well as distance
  51. - Outputs a Vector2 (direction * distance moved)
  52. - A OOB is used as a collider
  53. SliderDisc - position, normal, radius
  54. - When initially activated it records position nearest so the disc as the starting point
  55. - Further movement calculates the dynamic direction from the starting point to the current point on the plane the disc lies on
  56. - Distance along that direction is returned as amount of movement (similar to line slider)
  57. - Outputs a single float
  58. - A torus is used as a collider
  59. Free move/rotate/scale handles need to exist as well
  60. - Scale is easy, just perform uniform scale. Use SliderPlane oriented towards camera
  61. - Move also use SliderPlane oriented towards camera
  62. - Rotation use SliderDisc oriented towards camera
  63. ----------------------------------------------------
  64. STAGE 1
  65. CONCRETE TODO:
  66. HandleSliderPlane/HandleSliderDisc
  67. - update() implementation
  68. ----------------------------------------------------
  69. STAGE 2
  70. Implement RotateHandle & ScaleHandle in C#
  71. - Nearest point to disc/arc code
  72. Add free move, free rotate, free scale functionality
  73. Handles that remain the same size regardless of distance from camera
  74. - For both drawing and collision
  75. More complex types for drawing like DrawArrow in HandleDrawManager
  76. ----------------------------------------------------------------------
  77. SelectionRenderer
  78. Retrieve a list of selected objects from SelectionManager
  79. Find ones with Renderable components
  80. Retrieve Meshes, and world transforms from them
  81. Draw that same mesh with either a wireframe or a grayed out shader with a slight depth bias
  82. ---------------------------------------------------------------------
  83. Multi-resources
  84. Importer::import
  85. - Each SpecificImporter is responsible for importing all needed resources and registering them with Resources manager
  86. - However only the main resource is returned from that method
  87. - Rest of the resources are referenced by the UUID in ResourceMeta and can be retrieved there if needed
  88. Resources::save
  89. - Add to documentation that it will only save that exact resource and not any dependencies, you must call save() for them manually
  90. Resources::load
  91. - Will automatically load all dependencies, optionally add a boolean that allows you to load only the main asset
  92. ProjectLibrary
  93. - Needs to be extended so it shows sub-resources in tree view
  94. - 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?)
  95. ---------------------
  96. With this approach I can:
  97. - Reference and load the sub-resources directly
  98. - Technically I can also delete sub-resources