setStencilWrite.lua 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. return {
  2. tag = 'pipeline',
  3. summary = 'Set whether draws write to the stencil buffer.',
  4. description = [[
  5. Sets or disables stencil writes. When stencil writes are enabled, any pixels drawn will update
  6. the values in the stencil buffer using the `StencilAction` set.
  7. ]],
  8. arguments = {
  9. action = {
  10. type = 'StencilAction',
  11. description = 'How pixels drawn will update the stencil buffer.'
  12. },
  13. actions = {
  14. type = 'table',
  15. description = [[
  16. A list of 3 stencil actions, used when a pixel fails the stencil test, fails
  17. the depth test, or passes the stencil test, respectively.
  18. ]]
  19. },
  20. value = {
  21. type = 'number',
  22. default = '1',
  23. description = 'When using the \'replace\' action, this is the value to replace with.'
  24. },
  25. mask = {
  26. type = 'number',
  27. default = '0xff',
  28. description = 'An optional mask to apply to stencil values before writing.'
  29. }
  30. },
  31. returns = {},
  32. variants = {
  33. {
  34. arguments = { 'action', 'value', 'mask' },
  35. returns = {}
  36. },
  37. {
  38. arguments = { 'actions', 'value', 'mask' },
  39. returns = {}
  40. },
  41. {
  42. description = 'Disables stencil writing.',
  43. arguments = {},
  44. returns = {}
  45. }
  46. },
  47. notes = [[
  48. By default, stencil writes are disabled.
  49. Setting the stencil test requires the `Pass` to have a depth texture with the `d24s8` or
  50. `d32fs8` format (the `s` means "stencil"). The `t.graphics.stencil` and `t.headset.stencil`
  51. flags in `lovr.conf` can be used to request a stencil format for the default window and headset
  52. passes, respectively.
  53. ]],
  54. related = {
  55. 'Pass:setStencilTest',
  56. 'Pass:setDepthTest'
  57. }
  58. }