setBlendMode.lua 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. return {
  2. tag = 'pipeline',
  3. summary = 'Set the blend mode.',
  4. description = [[
  5. Sets the blend mode. When a pixel is drawn, the blend mode controls how it is mixed with the
  6. color and alpha of the pixel underneath it.
  7. ]],
  8. arguments = {
  9. index = {
  10. type = 'number',
  11. description = 'The index of the canvas texture that will use the new blend mode.'
  12. },
  13. blend = {
  14. type = 'BlendMode',
  15. description = 'The blend mode.'
  16. },
  17. alphaBlend = {
  18. type = 'BlendAlphaMode',
  19. description = 'The alpha blend mode, used to control premultiplied alpha.'
  20. }
  21. },
  22. returns = {},
  23. variants = {
  24. {
  25. description = 'Sets the blend mode for all canvas textures.',
  26. arguments = { 'blend', 'alphaBlend' },
  27. returns = {}
  28. },
  29. {
  30. description = [[
  31. Disables blending. When something is drawn, its pixel colors will replace any existing
  32. color in the target texture. This can work okay for opaque objects, but won't render text
  33. or transparency properly.
  34. ]],
  35. arguments = {},
  36. returns = {}
  37. },
  38. {
  39. description = 'Sets the blend mode for a single canvas texture.',
  40. arguments = { 'index', 'blend', 'alphaBlend' },
  41. returns = {}
  42. },
  43. {
  44. description = 'Disables blending for a single canvas texture.',
  45. arguments = { 'index' },
  46. returns = {}
  47. }
  48. },
  49. notes = 'The default blend mode is `alpha` with the `alphamultiply` alpha mode.'
  50. }