main.lua 435 B

1234567891011121314151617181920
  1. local shh = require 'shh'
  2. function lovr.load()
  3. skybox = lovr.graphics.newTexture('assets/industrial_workshop_foundry_2k.hdr', {
  4. usage = { 'storage', 'sample' }
  5. })
  6. colors = shh.new(skybox)
  7. print('Coefficients:')
  8. for i, color in ipairs(colors) do
  9. print(i, ('% 6f % 6f % 6f'):format(unpack(color)))
  10. end
  11. end
  12. function lovr.draw(pass)
  13. pass:skybox(skybox)
  14. shh.setShader(pass, colors)
  15. pass:sphere(0, 1.7, -2)
  16. end