init.lua 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. return {
  2. summary = 'A stream of graphics commands.',
  3. description = [[
  4. Pass objects are used to record work for the GPU. They contain a list of things to draw and a
  5. list of compute shaders to run.
  6. Methods like `Pass:sphere` will "record" a draw on the Pass, which adds it to the list. Other
  7. methods like `Pass:setBlendMode` or `Pass:setShader` will change the way the next draws are
  8. processed.
  9. Once all of the work has been recorded to a Pass, it can be sent to the GPU using
  10. `lovr.graphics.submit`, which will start processing all of the compute work and draws (in that
  11. order).
  12. A Pass can have a **canvas**, which is a set of textures that the draws will render to.
  13. `Pass:reset` is used to clear all of the computes and draws, putting the Pass in a fresh state.
  14. `lovr.draw` is called every frame with a `Pass` that is configured to render to either the
  15. headset or the window. The Pass will automatically get submitted afterwards.
  16. ]],
  17. constructors = {
  18. 'lovr.graphics.newPass',
  19. 'lovr.graphics.getWindowPass',
  20. 'lovr.headset.getPass',
  21. 'lovr.graphics.getPass'
  22. },
  23. sections = {
  24. {
  25. name = 'Drawing',
  26. tag = 'drawing',
  27. description = 'Draw objects and shapes.'
  28. },
  29. {
  30. name = 'Coordinate System',
  31. tag = 'transform',
  32. description = 'Manipulate the 3D coordinate system.'
  33. },
  34. {
  35. name = 'Render States',
  36. tag = 'pipeline',
  37. description = [[
  38. Set render states that change the way drawing happens. Render states can be saved and
  39. restored using `Pass:push` and `Pass:pop`.
  40. ]]
  41. },
  42. {
  43. name = 'Shaders',
  44. tag = 'shaders',
  45. description = [[
  46. Change the shader used for draws or computes, and set variables in the active shader.
  47. ]]
  48. },
  49. {
  50. name = 'Compute',
  51. tag = 'compute'
  52. },
  53. {
  54. name = 'Tally',
  55. tag = 'tally',
  56. description = [[
  57. Tallies are used to count the number of pixels affected by one or more draws. This can be
  58. used as a way to detect if an object is visible.
  59. ]]
  60. },
  61. {
  62. name = 'Camera',
  63. tag = 'camera'
  64. },
  65. {
  66. name = 'Canvas',
  67. tag = 'canvas'
  68. },
  69. {
  70. name = 'Miscellaneous',
  71. tag = 'pass-misc'
  72. }
  73. }
  74. }