setClear.lua 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. return {
  2. tag = 'canvas',
  3. summary = 'Set the clear values of the Pass.',
  4. description = [[
  5. Sets the clear values of the pass. This controls the initial colors of the canvas texture
  6. pixels at the beginning of the render pass. For each color texture, it can be one of the
  7. following:
  8. - A specific RGBA color value (or number for the depth texture).
  9. - `true`, to do a "fast clear" to undefined values. This is useful if the pass is going to end
  10. up drawing to all of the texture's pixels.
  11. - `false`, to avoid clearing and load the texture's existing pixels. This can be slow on mobile
  12. GPUs.
  13. ]],
  14. arguments = {
  15. hex = {
  16. type = 'number',
  17. description = 'A hexcode color to clear all color textures to.'
  18. },
  19. r = {
  20. type = 'number',
  21. description = 'The red component of the clear color.'
  22. },
  23. g = {
  24. type = 'number',
  25. description = 'The green component of the clear color.'
  26. },
  27. b = {
  28. type = 'number',
  29. description = 'The blue component of the clear color.'
  30. },
  31. a = {
  32. type = 'number',
  33. default = '1.0',
  34. description = 'The alpha component of the clear color.'
  35. },
  36. clear = {
  37. type = 'boolean',
  38. description = 'Whether color textures should be cleared.'
  39. },
  40. t = {
  41. type = 'table',
  42. description = [[
  43. A table of clear values. This can be a table of 4 numbers to use for all color textures, or
  44. it can be a list of boolean and/or RGBA tables to use for each individual color texture. It
  45. can also have a `depth` key with a boolean/number for the depth texture's clear.
  46. ]]
  47. }
  48. },
  49. returns = {},
  50. variants = {
  51. {
  52. description = 'Set the clear color for all color textures, using a hexcode.',
  53. arguments = { 'hex' },
  54. returns = {}
  55. },
  56. {
  57. description = 'Set the clear color for all color textures, using numbers.',
  58. arguments = { 'r', 'g', 'b', 'a' },
  59. returns = {}
  60. },
  61. {
  62. description = 'Set the clear color for all color textures, using a boolean.',
  63. arguments = { 'clear' },
  64. returns = {}
  65. },
  66. {
  67. description = [[
  68. Set the clear color for all color textures using a table, or set clear values for individual
  69. textures.
  70. ]],
  71. arguments = { 't' },
  72. returns = {}
  73. }
  74. },
  75. notes = [[
  76. If the depth clear is not given, it will be set to 0.
  77. All clear colors will default to transparent black (all zeros) when the Pass is created.
  78. ]],
  79. related = {
  80. 'Pass:setCanvas',
  81. 'Texture:clear'
  82. }
  83. }