Renderer.txt 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. 2. Gpu params update
  2. ISSUE - GpuParamBlock is tied to the hardware buffer. But I need separate param blocks for CPU and GPU. I need to break that tie
  3. and also ensure these blocks are marked as dirty/clean when needed.
  4. - I guess I could write these directly to the GPU buffer
  5. 3. Renderer parameters and buffers
  6. - Will likely need to finalize material <-> renderer interface matching first
  7. - Add a way to create renderer gpu buffers
  8. - Add a way to create handles to renderer gpu parameters (and store them in RenderableProxy)
  9. - Update renderable parameters each frame
  10. - Apply world view proj matrix in renderer
  11. IMPORTANT - Renderer now requires GpuparamBuffers to exist. Separate for each renderer semantic. Add
  12. GpuParamBlockBuffer emulation to DX9 (they can be user-specified via import settings or something).
  13. GpuParamBlockBuffer and GpuParams::cloneForCore are very clumsy in how they deal in keeping two separate param blocks. Rethink this a bit.
  14. Make sure to update param buffers in bulk before doing any rendering:
  15. - They're updated when material proxies are first created
  16. - When material proxies are updated
  17. - And when renderer updates its own parameters
  18. -----------------------------------------------------------
  19. NON TRIVIAL BUT SIMPLE
  20. Actually add frustum culling
  21. Implement RenderQueue sorting with support for sort type, priority and separable pass
  22. - Use a hash list(containing type, queue, layer, etc.) for faster sorting
  23. -----------------------------------------------------------
  24. REFACTORING, NOTES AND OTHER TRIVIAL STUFF
  25. Finally
  26. - Document elements marked with TODO UNDOCUMENTED
  27. - Refactor/rename everything so it makes more sense. Possibly lay out a design diagram.
  28. - Get rid of Camera::getIgnoreSceneRenderables it can be doing using layers
  29. - Delete RenderOperation as I don't think I use it anymore
  30. Semantic/design issues:
  31. - DrawList is too similar to RenderQueue - Their names need to be more distinct
  32. - Consider removing SceneManager from Core? I two scene manager base classes.
  33. -------------------------------------------------------
  34. Material compatibility:
  35. When renderer is first created we create a list of default materials, each corresponding to a single valid renderable type.
  36. When checking for material compatibility we compare parameter and param block descriptions between example
  37. and material we're comparing. This way I don't even have to check if shader has param block or not, I already
  38. know from the example material.
  39. When material proxy is bound to the renderer matching parameters are found, and the renderer will take care of filling them out.
  40. - If example material uses a param block but current material doesn't, even if parameters match we won't update them from renderer.
  41. - Material proxy will be updated with a helper structure describing the renderable type the material is created with
  42. - It will contain values representing which semantics are active
  43. - And pointers to those semantics buffers and param handles
  44. ---------------------------
  45. Just notes for later potentially:
  46. - I can only update entire Mesh at once.
  47. - I keep bounds for the entire mesh and not per-submesh
  48. - I don't serialize bounds and they are recalculated whenever a mesh is loaded