init.lua 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. return {
  2. summary = 'A stream of graphics commands.',
  3. description = [[
  4. Pass objects record work for the GPU. They contain a list of things to draw and a list of
  5. 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 draws appear. Render states can be saved and restored
  39. 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 = 'Tallies count the number of pixels that were visible for a draw.'
  57. },
  58. {
  59. name = 'Camera',
  60. tag = 'camera'
  61. },
  62. {
  63. name = 'Canvas',
  64. tag = 'canvas'
  65. },
  66. {
  67. name = 'Miscellaneous',
  68. tag = 'pass-misc'
  69. }
  70. }
  71. }