12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- return {
- summary = 'A stream of graphics commands.',
- description = [[
- Pass objects are used to record work for the GPU. They contain a list of things to draw and a
- list of compute shaders to run.
- Methods like `Pass:sphere` will "record" a draw on the Pass, which adds it to the list. Other
- methods like `Pass:setBlendMode` or `Pass:setShader` will change the way the next draws are
- processed.
- Once all of the work has been recorded to a Pass, it can be sent to the GPU using
- `lovr.graphics.submit`, which will start processing all of the compute work and draws (in that
- order).
- A Pass can have a **canvas**, which is a set of textures that the draws will render to.
- `Pass:reset` is used to clear all of the computes and draws, putting the Pass in a fresh state.
- `lovr.draw` is called every frame with a `Pass` that is configured to render to either the
- headset or the window. The Pass will automatically get submitted afterwards.
- ]],
- constructors = {
- 'lovr.graphics.newPass',
- 'lovr.graphics.getWindowPass',
- 'lovr.headset.getPass',
- 'lovr.graphics.getPass'
- },
- sections = {
- {
- name = 'Drawing',
- tag = 'drawing',
- description = 'Draw objects and shapes.'
- },
- {
- name = 'Coordinate System',
- tag = 'transform',
- description = 'Manipulate the 3D coordinate system.'
- },
- {
- name = 'Render States',
- tag = 'pipeline',
- description = [[
- Set render states that change the way drawing happens. Render states can be saved and
- restored using `Pass:push` and `Pass:pop`.
- ]]
- },
- {
- name = 'Shaders',
- tag = 'shaders',
- description = [[
- Change the shader used for draws or computes, and set variables in the active shader.
- ]]
- },
- {
- name = 'Compute',
- tag = 'compute'
- },
- {
- name = 'Tally',
- tag = 'tally',
- description = [[
- Tallies are used to count the number of pixels affected by one or more draws. This can be
- used as a way to detect if an object is visible.
- ]]
- },
- {
- name = 'Camera',
- tag = 'camera'
- },
- {
- name = 'Canvas',
- tag = 'canvas'
- },
- {
- name = 'Miscellaneous',
- tag = 'pass-misc'
- }
- }
- }
|