skybox.lua 857 B

1234567891011121314151617181920212223242526272829303132333435
  1. return {
  2. tag = 'graphicsPrimitives',
  3. summary = 'Render a skybox.',
  4. description = [[
  5. Render a skybox from a texture. Two common kinds of skybox textures are supported: A 2D
  6. equirectangular texture with a spherical coordinates can be used, or a "cubemap" texture created
  7. from 6 images.
  8. ]],
  9. arguments = {
  10. {
  11. name = 'texture',
  12. type = 'Texture',
  13. description = 'The texture to use.'
  14. }
  15. },
  16. returns = {},
  17. example = [[
  18. function lovr.load()
  19. skybox = lovr.graphics.newTexture({
  20. left = 'left.png',
  21. right = 'right.png',
  22. top = 'up.png',
  23. bottom = 'down.png',
  24. back = 'back.png',
  25. front = 'front.png'
  26. })
  27. -- or skybox = lovr.graphics.newTexture('equirectangular.png')
  28. end
  29. function lovr.draw()
  30. lovr.graphics.skybox(skybox)
  31. end
  32. ]]
  33. }