newSampler.lua 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. return {
  2. tag = 'graphics-objects',
  3. summary = 'Create a new Sampler.',
  4. description = [[
  5. Creates a new Sampler. Samplers are immutable, meaning their parameters can not be changed
  6. after the sampler is created. Instead, a new sampler should be created with the updated
  7. properties.
  8. ]],
  9. arguments = {
  10. parameters = {
  11. type = 'table',
  12. description = 'Parameters for the sampler.',
  13. table = {
  14. {
  15. name = 'filter',
  16. type = 'table',
  17. default = [['linear']],
  18. description = [[
  19. How the sampler smooths texture pixels. Can be a table of 3 FilterModes, or a single
  20. FilterMode to use for all three.
  21. ]],
  22. table = {
  23. {
  24. name = '[1]',
  25. type = 'FilterMode',
  26. description = [[
  27. The filter mode to use when minifying a texture (drawing it at a smaller size than
  28. its native pixel resolution).
  29. ]]
  30. },
  31. {
  32. name = '[2]',
  33. type = 'FilterMode',
  34. description = [[
  35. The filter mode to use when magnifying a texture (drawing it at a larger size than
  36. its native pixel resolution).
  37. ]]
  38. },
  39. {
  40. name = '[3]',
  41. type = 'FilterMode',
  42. description = 'The filter mode used to smooth between mipmap levels in a texture.'
  43. }
  44. }
  45. },
  46. {
  47. name = 'wrap',
  48. type = 'table',
  49. default = [['repeat']],
  50. description = [[
  51. How the sampler behaves when wrapping UVs outside the 0-1 range. Can be a table of 3
  52. WrapModes, or a single WrapMode to use for all three axes.
  53. ]],
  54. table = {
  55. {
  56. name = '[1]',
  57. type = 'WrapMode',
  58. description = 'The horizontal wrap mode.'
  59. },
  60. {
  61. name = '[2]',
  62. type = 'WrapMode',
  63. description = 'The vertical wrap mode.'
  64. },
  65. {
  66. name = '[3]',
  67. type = 'FilterMode',
  68. description = 'The "z" wrap mode for 3D textures.'
  69. }
  70. }
  71. },
  72. {
  73. name = 'compare',
  74. type = 'CompareMode',
  75. default = [['none']],
  76. description = 'The compare mode of the sampler (for shadow samplers).'
  77. },
  78. {
  79. name = 'anisotropy',
  80. type = 'number',
  81. default = '1',
  82. description = 'The maximum amount of anisotropic filtering to use.'
  83. },
  84. {
  85. name = 'mipmaprange',
  86. type = 'table',
  87. description = 'A table of 2 mipmap levels the sampler will clamp to.'
  88. }
  89. }
  90. }
  91. },
  92. returns = {
  93. sampler = {
  94. type = 'Sampler',
  95. description = 'The new sampler.'
  96. }
  97. },
  98. variants = {
  99. {
  100. arguments = { 'parameters' },
  101. returns = { 'sampler' }
  102. }
  103. },
  104. related = {
  105. 'Pass:setSampler'
  106. }
  107. }