setTransform.lua 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. return {
  2. summary = 'Set the transformation applied to texture coordinates.',
  3. description = [[
  4. Sets the transformation applied to texture coordinates of the Material. This lets you offset,
  5. scale, or rotate textures as they are applied to geometry.
  6. ]],
  7. arguments = {
  8. {
  9. name = 'ox',
  10. type = 'number',
  11. description = 'The texture coordinate x offset.'
  12. },
  13. {
  14. name = 'oy',
  15. type = 'number',
  16. description = 'The texture coordinate y offset.'
  17. },
  18. {
  19. name = 'sx',
  20. type = 'number',
  21. description = 'The texture coordinate x scale.'
  22. },
  23. {
  24. name = 'sy',
  25. type = 'number',
  26. description = 'The texture coordinate y scale.'
  27. },
  28. {
  29. name = 'angle',
  30. type = 'number',
  31. description = 'The texture coordinate rotation, in radians.'
  32. }
  33. },
  34. returns = {},
  35. notes = [[
  36. Although texture coordinates will automatically be transformed by the Material's transform, the
  37. material transform is exposed as the `mat3 lovrMaterialTransform` uniform variable in shaders,
  38. allowing it to be used for other purposes.
  39. ]]
  40. }