generateMipmaps.lua 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. return {
  2. tag = 'texture-transfer',
  3. summary = 'Regenerate mipmaps for a Texture.',
  4. description = [[
  5. Regenerates mipmap levels of a texture. This downscales pixels from the texture to
  6. progressively smaller sizes and saves them. If the texture is drawn at a smaller scale later,
  7. the mipmaps are used, which smooths out the appearance and improves performance.
  8. ]],
  9. arguments = {
  10. base = {
  11. type = 'number',
  12. default = '1',
  13. description = 'The base mipmap level which will be used to generate subsequent mipmaps.'
  14. },
  15. count = {
  16. type = 'number',
  17. default = 'nil',
  18. description = [[
  19. The number of mipmap levels to generate. If nil, the rest of the mipmaps will be generated.
  20. ]]
  21. }
  22. },
  23. returns = {},
  24. variants = {
  25. {
  26. arguments = { 'base', 'count' },
  27. returns = {}
  28. }
  29. },
  30. notes = [[
  31. Mipmaps will automatically be regenerated for textures after rendering to them in a `Pass`.
  32. This can be disabled by rendering to a single-level texture view instead.
  33. The texture must have been created with the `transfer` usage to mipmap it.
  34. The texture can not be multisampled.
  35. Texture views can not currently be mipmapped.
  36. ]],
  37. related = {
  38. 'Texture:setPixels',
  39. 'Texture:getMipmapCount'
  40. }
  41. }