stencil.lua 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. return {
  2. tag = 'graphicsPrimitives',
  3. summary = 'Modify the stencil buffer.',
  4. description = 'Renders to the stencil buffer using a function.',
  5. arguments = {
  6. callback = {
  7. type = 'function',
  8. arguments = {},
  9. returns = {},
  10. description = 'The function that will be called to render to the stencil buffer.'
  11. },
  12. action = {
  13. type = 'StencilAction',
  14. default = [['replace']],
  15. description = 'How to modify the stencil value of pixels that are rendered to.'
  16. },
  17. value = {
  18. type = 'number',
  19. default = '1',
  20. description = 'If `action` is "replace", this is the value that pixels are replaced with.'
  21. },
  22. keep = {
  23. type = 'boolean',
  24. default = 'false',
  25. description = 'If false, the stencil buffer will be cleared to zero before rendering.'
  26. },
  27. initial = {
  28. type = 'number',
  29. default = '0',
  30. description = 'The value to clear the stencil buffer to before rendering.'
  31. }
  32. },
  33. returns = {},
  34. variants = {
  35. {
  36. arguments = { 'callback', 'action', 'value', 'keep' },
  37. returns = {}
  38. },
  39. {
  40. arguments = { 'callback', 'action', 'value', 'initial' },
  41. returns = {}
  42. }
  43. },
  44. notes = 'Stencil values are between 0 and 255.',
  45. related = {
  46. 'lovr.graphics.getStencilTest',
  47. 'lovr.graphics.setStencilTest'
  48. }
  49. }