setStencilTest.lua 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. return {
  2. tag = 'pipeline',
  3. summary = 'Configure the stencil test.',
  4. description = [[
  5. Sets the stencil test. Any pixels that fail the stencil test won't be drawn. For example,
  6. setting the stencil test to `('equal', 1)` will only draw pixels that have a stencil value of 1.
  7. The stencil buffer can be modified by drawing while stencil writes are enabled with
  8. `lovr.graphics.setStencilWrite`.
  9. ]],
  10. arguments = {
  11. test = {
  12. type = 'CompareMode',
  13. description = 'The new stencil test to use.'
  14. },
  15. value = {
  16. type = 'number',
  17. description = 'The stencil value to compare against.'
  18. },
  19. mask = {
  20. type = 'number',
  21. default = '0xff',
  22. description = 'An optional mask to apply to stencil values before the comparison.'
  23. }
  24. },
  25. returns = {},
  26. variants = {
  27. {
  28. arguments = { 'test', 'value', 'mask' },
  29. returns = {}
  30. },
  31. {
  32. description = 'Disable the stencil test.',
  33. arguments = {},
  34. returns = {}
  35. }
  36. },
  37. notes = [[
  38. The stencil test is disabled by default.
  39. Setting the stencil test requires the `Pass` to have a depth texture with the `d24s8` or
  40. `d32fs8` format (the `s` means "stencil"). The `t.graphics.stencil` and `t.headset.stencil`
  41. flags in `lovr.conf` can be used to request a stencil format for the default window and headset
  42. passes, respectively.
  43. ]],
  44. related = {
  45. 'Pass:setStencilWrite',
  46. 'Pass:setDepthTest'
  47. }
  48. }