1
0
Fork 0
mirror of https://github.com/bjornbytes/lovr.git synced 2024-07-02 12:33:52 +00:00
lovr/etc/nogame.lua
bjorn 10c2c75482 Frustum culling;
- Adds Pass:setViewCull to enable/disable frustum culling.
- Renames Pass:setCullMode to Pass:setFaceCull (with backcompat).

Some stuff currently missing:

- Text is not culled, but should be.
- VR view frusta are not merged yet.
2023-07-07 14:51:22 -07:00

45 lines
1.1 KiB
Lua

function lovr.conf(t)
t.headset.supersample = true
t.modules.audio = false
t.modules.physics = false
t.modules.thread = false
end
function lovr.load()
if not lovr.graphics then
print(string.format('LÖVR %d.%d.%d\nNo game', lovr.getVersion()))
lovr.event.quit()
return
end
if lovr.headset.getPassthrough() == 'opaque' then
lovr.graphics.setBackgroundColor(0x20232c)
end
logo = lovr.graphics.newShader('unlit', 'logo')
end
function lovr.draw(pass)
local padding = .1
local font = lovr.graphics.getDefaultFont()
local fade = .315 + .685 * math.abs(math.sin(lovr.headset.getTime() * 2))
local titlePosition = 1.5 - padding
local subtitlePosition = titlePosition - font:getHeight() * .25 - padding
pass:setFaceCull(true)
pass:setShader(logo)
pass:plane(0, 2, -3)
pass:setShader()
pass:text('LÖVR', -.012, titlePosition, -3, .25, quat(0, 0, 1, 0), nil, 'center', 'top')
pass:setColor(.9, .9, .9, fade)
pass:text('No game :(', -.005, subtitlePosition, -3, .15, 0, 0, 1, 0, nil, 'center', 'top')
end
function lovr.keypressed(key)
if key == 'escape' then
lovr.event.quit()
end
end