This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| vec2, vec3, vec4, quat = {}, {}, {}, {} | |
| Vec2, Vec3, Vec4, Quat = vec2, vec3, vec4, quat | |
| lovr.math.vec2, lovr.math.vec3, lovr.math.vec4, lovr.math.quat = vec2, vec3, vec4, quat | |
| lovr.math.newVec2, lovr.math.newVec3, lovr.math.newVec4, lovr.math.newQuat = vec2, vec3, vec4, quat | |
| local function isvec2(t) return type(t) == 'table' end | |
| local function isvec3(t) return type(t) == 'table' end | |
| local function isvec4(t) return type(t) == 'table' end | |
| local function isquat(t) return type(t) == 'table' end | |
| local function ismat4(m) return type(m) == 'userdata' and m:type() == 'Mat4' end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fontShader = lovr.graphics.newShader('unlit', [[ | |
| Constants { | |
| uint supersample; | |
| }; | |
| // Standard sample locations from Vulkan spec | |
| const vec2 samples16[16] = vec2[16]( | |
| vec2(.0625, .0625), | |
| vec2(-.0625, -.1875), | |
| vec2(-.1875, .125), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --[[ | |
| local renderdoc = require 'renderdoc' | |
| function lovr.draw(pass) | |
| pass:cube(0, 1.7, -1, .5, lovr.timer.getTime()) | |
| if renderdoc.available and lovr.headset.wasPressed('right', 'trigger') then | |
| renderdoc.api.StartFrameCapture(nil, nil) | |
| lovr.graphics.submit(pass) | |
| renderdoc.api.EndFrameCapture(nil, nil) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| local mirror = {} | |
| function mirror:init() | |
| self.head = lovr.math.newMat4() | |
| self.views = 2 | |
| self.width = lovr.system.getWindowWidth() * .5 | |
| self.height = lovr.system.getWindowHeight() | |
| self.ipd = .063 | |
| self.fovy = .6 | |
| self.fovx = self.fovy * (self.width / self.height) |