noise.lua 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. return {
  2. tag = 'random',
  3. summary = 'Generate perlin noise.',
  4. description = [[
  5. Returns a 1D, 2D, 3D, or 4D perlin noise value. The number will be between 0 and 1, and it will
  6. always be 0.5 when the inputs are integers.
  7. ]],
  8. arguments = {
  9. x = {
  10. type = 'number',
  11. description = 'The x coordinate of the input.'
  12. },
  13. y = {
  14. type = 'number',
  15. description = 'The y coordinate of the input.'
  16. },
  17. z = {
  18. type = 'number',
  19. description = 'The z coordinate of the input.'
  20. },
  21. w = {
  22. type = 'number',
  23. description = 'The w coordinate of the input.'
  24. }
  25. },
  26. returns = {
  27. noise = {
  28. type = 'number',
  29. description = 'The noise value, between 0 and 1.'
  30. }
  31. },
  32. variants = {
  33. {
  34. arguments = { 'x' },
  35. returns = { 'noise' }
  36. },
  37. {
  38. arguments = { 'x', 'y' },
  39. returns = { 'noise' }
  40. },
  41. {
  42. arguments = { 'x', 'y', 'z' },
  43. returns = { 'noise' }
  44. },
  45. {
  46. arguments = { 'x', 'y', 'z', 'w' },
  47. returns = { 'noise' }
  48. }
  49. },
  50. related = {
  51. 'lovr.math.random'
  52. }
  53. }