setPassthrough.lua 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. return {
  2. tag = 'headset',
  3. summary = 'Change current passthrough mode.',
  4. description = [[
  5. Sets a new passthrough mode. Not all headsets support all passthrough modes. Use
  6. `lovr.headset.getPassthroughModes` to see which modes are supported.
  7. ]],
  8. arguments = {
  9. transparent = {
  10. type = 'boolean',
  11. description = [[
  12. Whether the headset should use a transparent passthrough mode. When false, this will
  13. request the `opaque` mode. When true, either `blend` or `add` will be requested, based on
  14. what the VR runtime supports.
  15. ]]
  16. },
  17. mode = {
  18. type = 'PassthroughMode',
  19. description = 'The passthrough mode to request.'
  20. }
  21. },
  22. returns = {
  23. success = {
  24. type = 'boolean',
  25. description = 'Whether the passthrough mode was supported and successfully enabled.'
  26. }
  27. },
  28. variants = {
  29. {
  30. arguments = { 'mode' },
  31. returns = { 'success' }
  32. },
  33. {
  34. arguments = { 'transparent' },
  35. returns = { 'success' }
  36. },
  37. {
  38. description = 'Switch to the headset\'s default passthrough mode.',
  39. arguments = {},
  40. returns = { 'success' }
  41. },
  42. },
  43. notes = [[
  44. When using one of the transparent passthrough modes, be sure to set the alpha of the background
  45. color to zero using `lovr.graphics.setBackgroundColor`, so the background shows through.
  46. ]],
  47. related = {
  48. 'lovr.headset.getPassthroughModes'
  49. }
  50. }