从源码构建需自行安装 CMake 工具链;官方推荐直接下载可执行文件,把 main.lua 拖到可执行文件上运行;加载 glTF 模型等资源需自行准备资源文件。
mkdir build
cd build
cmake ..
cmake --build .README 未说明具体显存或 GPU 型号要求;运行平台为 Windows、macOS、Linux 和 Android,VR 需兼容 OpenXR 的头显,无头显时可用键鼠模拟器。
用 Lua 快速搭建 3D 游戏和 VR 体验的轻量框架,跨平台跨头显
用 Lua 写 VR 应用的轻量框架,封装 OpenXR/OpenVR 接口,让开发者不用碰底层 C 代码就能快速做出虚拟现实游戏和交互体验。
核心能力
- 用 LuaJIT 脚本编写,几行代码即可创建 3D 场景
- 支持所有兼容 OpenXR 的头显,并内置键鼠 VR 模拟器
- C11 实现,含优化的单通道立体渲染
- 提供计算着色器、光线追踪、间接渲染等 GPU 能力
- 内置 JoltPhysics 刚体物理与 SteamAudio 空间音频
容易踩的坑
- v0.19.0Forbidden Jorts最新正式版2026-06-07 · 2026-06-07 21:12 UTC
Add
General
- Add
lovr.taskmodule andlovr.taskreadycallback. - Add support for compiling with Luau as the Lua implementation, instead of Lua/LuaJIT.
- Add support for passing Luau
vectorandquaterniontypes to functions. - Add
vectorandquaternionmodules.
Audio
- Add
AudioMeshandlovr.audio.newAudioMesh. - Add support for ambisonic source playback.
- Add
lovr.audio.setHRTFto set a custom HRTF. - Add
Source:get/setAbsorption. - Add
Source:get/setCone. - Add
Source:get/setFalloff. - Add
Source:get/setOcclusion. - Add
Source:get/setReverb. - Add
Source:get/setSpatialization. - Add
lovr.audio.updateto atomically commit changes to audio sources. - Add
lovr.audio.getStream. - Add
t.audio.debugandt.audio.reverbsettings tolovr.conf.
Data
- Add
AudioStreamandlovr.data.newAudioStream. - Add
Blob:setI8/setU8/setI16/setU16/setI32/setU32/setF32/setF64. - Add
lovr.data.newBlobView. - Add
Model(Data):getNodeChild/getNodeSibling. - Add
Model(Data):getNodeMesh(replaces:getNodeMeshes). - Add
ModelData:getMeshBlendShapeCount/getMeshBlendShapeName/getBlendVertex. - Add
ModelData:getMeshPartCount. - Add
ModelData:getMeshDrawRange. - Add support for importing two sets of UVs in
ModelData. - Add
Sound:get/setFrame.
Graphics
- Add
Raytracer,lovr.graphics.newRaytracer, andraytracingGraphicsFeature. - Add
raytraceroption tolovr.graphics.newMeshandlovr.graphics.newModel. - Add
Mesh:buildRaytracerandModel:buildRaytracer. - Add
VertexUV2builtin vertex attribute andUV2shader variable, for lightmapping. - Add
t.graphics.hdrandlovr.graphics.isHDR. - Add
pqToLinear,linearToPQ,sRGBToRec2020, andrec2020ToSRGBshader helpers. - Add
Pass:getViewRay. - Add
Pass:setBlendState. - Add
Pass:drawPartto draw a single part of aModel. - Add
Model:meshesto iterate over model nodes with meshes. - Add
Model:is/setNodeVisible. - Add
lovr.graphics.getStatsfor GPU memory allocation statistics. - Add support for creating 3D texture views.
- Add
Mesh:get/setBaseVertex. - Add support for custom array strides in buffer formats.
- Add
bgra8TextureFormat. - Add
Buffer:newBlob.
Headset
- Add
lovr.modelschangedevent. - Add
lovr.headset.getModelKeys. - Add support for "foveated quad" and "mono" display configurations.
- Add
Layer:get/setOriginto lock Layer poses to a Device. - Add
dpup,dpdown,dpleft,dprightDeviceButton. - Add
bumperDeviceButton. - Add
bodyDevicefor full-body tracking inlovr.headset.getSkeleton. - Add
lovr.simulatecallback to customize the headset simulator. - Add support for Touch Pro controllers.
- Add
thumbrestHeadsetAxis, for pressure-sensitive thumbrests. - Add
t.headset.extensionsto enable extra OpenXR extensions. - Add
lovr.headset.connectandt.headset.connect. - Add
lovr.headset.setPosition/Orientation/Poseandlovr.headset.setButton.
Math
- Add
Curve:getLengthandCurve:step. - Add
Mat4:setPosition/Orientation/Scale/Pose.
Physics
- Add support for non-uniform scale in
ConvexShapeandMeshShape.
System
- Add
t.window.centered. - Add
lovr.system.is/setWindowFullscreen. - Add
lovr.system.get/setMouseMode.
Thread
- Add
lovr.thread.call. - Add
lovr.thread.getWorkerCount.
Change
- Change model loading to use multiple threads to load images.
- Change
Pass:setProjectionto accept aProjectionType. - Change
lovr.graphics.newModelto no longer retain itsModelData, allowing its memory to be freed. - Change functions to accept tables for vector/quaternion arguments instead of userdata vector types.
- Change
requireto have better errors when files/plugins aren't found. - Change default require path to also search for
.luaufiles, when using Luau. - Change `lovr.headset.newMo
- Add
- v0.18.0Dream Eater2025-02-15 · 2025-02-15 02:51 UTC
查看更新说明
Add
General
- Add support for declaring objects as to-be-closed variables in Lua 5.4.
Filesystem
- Add
--watchCLI flag,lovr.filechangedevent, andlovr.filesystem.watch/unwatch. - Add
Fileobject andlovr.filesystem.newFile. - Add
lovr.filesystem.getBundlePath(for internal boot code). - Add
lovr.filesystem.setSource(for internal boot code).
Graphics
- Add
Pass:polygon. - Add
Shader:hasVariable. - Add support for BMFont in
FontandRasterizer. - Add support for
uniformvariables in shader code. - Add support for cubemap array textures.
- Add support for transfer operations on texture views.
- Add support for nesting texture views (creating a view of a view).
- Add
sn10x3DataType. - Add
borderWrapMode. - Add support for loading glTF models with 8 bit indices.
- Add support for
d24texture format. - Add support for
SampleID,SampleMaskIn,SampleMask, andSamplePositionin pixel shaders. - Add support for
layout(scalar)buffers andpackedBuffersgraphics feature. - Add
rawflag tolovr.graphics.newShader. - Add
Texture:getLabel,Shader:getLabel, andPass:getLabel. - Add
Model:resetBlendShapes.
Headset
- Add
Layerobject,lovr.headset.newLayer, andlovr.headset.get/setLayers. - Add
stylusDevice,nibDeviceButton, andnibDeviceAxis. - Add support for Logitech MX Ink input.
- Add
lovr.headset.get/setFoveation. - Add
t.headset.controllerskeletonto control how controllers return hand tracking data. - Add
controllerfield to the table returned bylovr.headset.getSkeleton. - Add
t.headset.mask. - Add back
lovr.headset.isMountedand thelovr.mountcallback. - Add
lovr.headset.stop,lovr.headset.isActive, andt.headset.start. - Add
lovr.headset.getFeatures. - Add
t.headset.debugto enable additional messages from the VR runtime. - Add
--simulatorCLI flag to force use of simulator headset driver. - Add
lovr.headset.getHandles.
Math
- Add
Quat:get/setEuler.
Physics
- Add variant of
lovr.physics.newWorldthat takes a table of settings. - Add
World:interpolate. - Add
World:get/setCallbacksandContactobject. - Add
World:getColliderCount. - Add
World:getJointCountandWorld:getJoints. - Add
World:shapecast. - Add
World:overlapShape. - Add
Collider:get/setGravityScale. - Add
Collider:is/setContinuous. - Add
Collider:get/setDegreesOfFreedom. - Add
Collider:applyLinearImpulseandCollider:applyAngularImpulse. - Add
Collider:moveKinematic. - Add
Collider:getShape. - Add
Collider:is/setSensor(replacesShape:is/setSensor). - Add
Collider:get/setInertia. - Add
Collider:get/setCenterOfMass. - Add
Collider:get/setAutomaticMass. - Add
Collider:resetMassData. - Add
Collider:is/setEnabled. - Add
ConvexShape. - Add
WeldJoint. - Add
ConeJoint. - Add
Joint:getForceandJoint:getTorque. - Add
Joint:get/setPriority. - Add
Joint:isDestroyed. - Add
DistanceJoint:get/setLimits. - Add
:get/setSpringtoDistanceJoint,HingeJoint, andSliderJoint. - Add
HingeJoint:get/setFrictionandSliderJoint:get/setFriction. - Add
SliderJoint:getAnchors. - Add
Shape:raycastandShape:containsPoint. - Add
Shape:get/setDensity. - Add
Shape:getMass/Volume/Inertia/CenterOfMass. - Add
Shape:get/setOffset. - Add motor support to
HingeJointandSliderJoint. - Add support for creating a
MeshShapefrom aModelData.
System
- Add
lovr.system.isWindowVisibleandlovr.system.isWindowFocused. - Add
lovr.system.wasMousePressedandlovr.system.wasMouseReleased. - Add
lovr.system.get/setClipboardText. - Add
lovr.system.openConsole(for internal Lua code). - Add
KeyCodes for numpad keys.
Thread
- Add table support to
Channel:push. - Add
lovr.thread.newChannel. - Add
t.thread.workersto configure number of worker threads.
- v0.17.12024-03-12 · 2024-03-12 19:20 UTC
查看更新说明
Change
- Change permissions for files and directories created by
lovr.filesystemon POSIX (fixes ADB on Android 12+). - Change
Pass:sphereto error when segment count is too small. - Change
Buffer:setDatato error when copying within a single Buffer with overlapping byte ranges.
Fix
- Fix LÖVR failing to start on Oculus Quest v62+.
- Fix
Pass:skyboxto render cubemaps with the correct X/Z orientation. - Fix depth write when depth testing is disabled.
- Fix
lovr.graphics.newModelto support empty GLB models. - Fix
lovr.graphics.newModelto support models without any vertices. - Fix bitangent sign in
TangentMatrixbuiltin. - Fix shader #includes to error when including a file that doesn't exist.
- Fix
lovr.quitto not get called twice when canceling quit. - Fix GPU error when texture had only
transferusage. - Fix rare crash when calling vector methods.
- Fix
Model:getMesh.
- Change permissions for files and directories created by
- v0.17.0Tritium Gourmet2023-10-15 · 2023-10-15 03:07 UTC
查看更新说明
Add
General
- Add
enetplugin. - Add
httpplugin. - Add
utf8module. - Add
:typemethod to all objects and vectors. - Add
--graphics-debugcommand line option, which setst.graphics.debugto true.
Audio
- Add
lovr.audio.getDevice.
Data
- Add
Image:mapPixel. - Add a variant of
Blob:getStringthat takes a byte range. - Add
Blob:getI8/getU8/getI16/getU16/getI32/getU32/getF32/getF64.
Filesystem
- Add argument to
lovr.filesystem.loadto restrict chunks to text/binary.
Graphics
- Add
Pass:roundrect. - Add variant of
Pass:conethat takes twovec3endpoints. - Add variant of
Pass:drawthat takes aTexture. - Add
Pass:setViewCullto enable frustum culling. - Add
Model:getBlendShapeWeight, andModel:setBlendShapeWeight. - Add
Model(Data):getBlendShapeCount,Model(Data):getBlendShapeName. - Add support for animated blend shape weights in Model animations.
- Add support for arrays, nested structs, and field names to Buffer formats.
- Add
Shader:getBufferFormat. - Add back
Meshobject (sorry!). - Add
Model:clone. - Add
materialsflag tolovr.graphics.newModel. - Add
lovr.graphics.isInitialized(mostly internal). - Add support for using depth textures in multisampled render passes.
- Add
depthResolvefeature tolovr.graphics.getFeatures. - Add a variant of
Texture:newViewthat creates a 2D slice of a layer/mipmap of a texture. - Add a variant of
Pass:sendthat takes tables for uniform buffers. - Add
Buffer:getDataandBuffer:newReadback. - Add
Texture:getPixels/setPixels/clear/newReadback/generateMipmaps. - Add support for stepping through shaders in e.g. RenderDoc when
t.graphics.debugis set. - Add
lovr.graphics.is/setTimingEnabledto record GPU durations for each Pass object. - Add
lovr.graphics.newPass. - Add
Pass:setCanvasandPass:setClear. - Add
Pass:getStats. - Add
Pass:reset. - Add
Pass:getScissorandPass:getViewport. - Add
Pass:barrier. - Add
Pass:beginTally/finishTallyandPass:get/setTallyBuffer. - Add support for
#includein shader code.
Headset
- Add
lovr.headset.getPassthrough/setPassthrough/getPassthroughModes. - Add support for more headsets in Android APKs (Quest, Pico, Vive Focus all work).
- Add support for controller input on Pico Neo 3 and Pico Neo 4 devices.
- Add support for controller input on Magic Leap 2.
- Add
hand/*/pinch,hand/*/poke, andhand/*/gripDevices. - Add support for using
lovr.headsetwhenlovr.graphicsis disabled, on supported runtimes. - Add support for
elbow/leftandelbow/rightposes on Ultraleap hand tracking. - Add
lovr.headset.getDirection. - Add
lovr.headset.isVisibleandlovr.visiblecallback. - Add
lovr.recentercallback. - Add
floorDevice. - Add
t.headset.seatedandlovr.headset.isSeated. - Add
lovr.headset.stopVibration. - Add
radiusfields to joint tables returned bylovr.headset.getSkeleton. - Add support for "sprinting" in the headset simulator using the shift key.
Math
- Add capitalized globals for creating permanent vectors (
Vec2,Vec3,Vec4,Quat,Mat4). - Add
Vec3:transform,Vec4:transform, andVec3:rotate. - Add vector constants (
vec3.up,vec2.one,quat.identity, etc.). - Add
Mat4:getTranslation/getRotation/getScale/getPose. - Add variant of
Vec3:setthat takes aQuat. - Add
Mat4:reflect.
Physics
- Add
TerrainShape. - Add
World:queryBoxandWorld:querySphere. - Add
World:getTags. - Add
Shape:get/setPose. - Add missing
lovr.physics.newMeshShapefunction. - Add
Collider:isDestroyed.
System
- Add
lovr.system.wasKeyPressed/wasKeyReleased. - Add
lovr.system.getMouseX,lovr.system.getMouseY, andlovr.system.getMousePosition. - Add
lovr.system.isMouseDown. - Add
lovr.mousepressed,lovr.mousereleased,lovr.mousemoved, andlovr.wheelmovedcallb
- Add
- v0.16.0Toad Rage2022-10-16 · 2022-10-16 04:55 UTC
查看更新说明
Add:
- Add ability to run individual Lua files in addition to folders.
- Add Vulkan renderer.
- Add capsule, cone, and torus shapes.
- Add
segmentsoption to planes. - Add option to draw a single node of a model.
- Add indirect draws and indirect compute.
- Add depth clamp and depth offset render states.
- Add support for configuring "stencil fail" and "depth fail" stencil actions.
- Add viewport and scissor render states.
- Add
Passobjects for recording rendering work. - Add
Bufferobjects. - Add
Buffer:getPointerfor accessing FFI pointers to GPU memory. - Add support for half floats for vertex attributes and buffer data.
- Add texture views.
- Add single-pass rendering to multi-layer textures (array, cubemap, 3D).
- Add
r8,rg8,r16,rg16,rgba16, andrgb565image and texture formats. - Add
d32fs8texture format. - Add support for BC4, BC5, BC6, and BC7 texture formats.
- Add support for loading uncompressed formats from DDS and KTX files.
- Add support for loading KTX2 textures.
- Add support for loading non-2D textures from image files.
- Add support for loading DDS and KTX textures in glTF models.
- Add support for the
KHR_texture_transformglTF extension. - Add support for loading base64 images from glTF models.
- Add
Samplerobjects. - Add
Tallyobjects for GPU queries. - Add
Readbackobjects for asynchronous GPU readbacks. - Add
t.graphics.shadercacheoption to cache compiled shaders to disk. - Add
lovr.graphics.compileShaderand the ability to load shaders from SPIR-V. - Add
normaldefault shader. - Add
Font:getKerning. - Add
Font:getLines. - Add
Font:getVertices. - Add support for rendering multicolor text.
- Add
Pass:blit,Pass:clear,Pass:copy,Pass:mipmap, andPass:readfor raw GPU transfers. - Add
lovr.graphics.isFormatSupportedandlovr.graphics.getDevice. - Add
eye/gazeDevice. - Add
t.headset.submitdepthflag to submit depth buffers to the OpenXR runtime. - Add
t.headset.overlayconf.lua flag to run as an OpenXR overlay. - Add support for
keyboarddevice pose on Oculus Quest. - Add support for reading hand tracking pinch strength (it's mapped to trigger).
- Add
thumbrestDeviceButton. - Add OpenXR support for
a,b,x, andyDeviceButtons. - Add OpenXR support for
hand/left/pointandhand/right/pointDevices. - Add OpenXR support for Windows Mixed Reality controllers.
- Add OpenXR support for Oculus Quest hand tracking models via
lovr.headset.newModel. - Add OpenXR support for Vive tracker devices.
- Add OpenXR support for
lovr.headset.getDisplayFrequency. - Add
lovr.headset.setDisplayFrequencyandlovr.headset.getDisplayFrequencies. - Add
lovr.headset.isFocused. - Add
lovr.headset.getDeltaTime. - Add support for passing
vec2s as scale arguments. - Add support for passing numbers when calling functions on vectors.
- Add functions to
ModelData(it didn't have any before, now it has lots). - Add bounding sphere to
ModelandModelData. - Add ability to procedurally animate model node scales.
- Add
Model:getMetadatato return raw JSON from glTF models. - Add
Rasterizer:getWidth,Rasterizer:getDimensions, andRasterizer:getBoundingBox. - Add
Rasterizer:getKerningandRasterizer:getBearing. - Add
Rasterizer:getCurves. - Add
Rasterizer:newImage. - Add
Vec2:angle,Vec3:angle, andVec4:angle. - Add
Vec2:equals,Vec3:equals,Vec4:equals,Quat:equals, andMat4:equals. - Add
Sound:getCapacityandSound:getByteStride. - Add
Source:get/setPitch. - Add
Source:isSpatialandspatialflag tolovr.audio.newSource. - Add macOS support for requesting the
audiocapturePermission withlovr.system.requestPermission. - Add
World:getContacts. - Add
World:get/setStepCount. - Add
lovr.system.isKeyDown.
Change:
- Change default headset driver to OpenXR.
- Change
lovr.headset.getSkeletonto also return joint r
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
LÖVR
A simple Lua framework for rapidly building 3D games and VR experiences.
Homepage | Documentation | FAQ
Features
- Cross-Platform - Runs on Windows, macOS, Linux, and Android.
- Cross-Device - Supports any headset that works with OpenXR, and has a keyboard/mouse VR simulator.
- Beginner-friendly - Simple scenes can be created in just a few lines of Lua.
- Fast - Written in C11 and scripted with LuaJIT, includes optimized single-pass stereo rendering.
- Tiny - The whole framework is just a couple of megabytes, and it's easy to disable/remove modules.
- Powerful GPU APIs - Compute shaders, ray tracing, indirect rendering, atomics, and more.
- Asset Import - Supports glTF models, skeletal animation, compressed textures, cubemaps, fonts, etc.
- 3D Rigid Body Physics - Includes JoltPhysics, with 7 collider shapes and 6 types of joints.
- Spatialized Audio - Uses SteamAudio for audio spatialization, with HRTFs, audio meshes, and reverb.
- Vector Library - Built-in 3D vectors, quaternions, and matrices.
Getting Started
It's really easy to get started making things with LÖVR. Grab a copy of the executable from https://lovr.org/downloads,
then write a main.lua script and drag it onto the executable. Here are some example projects to try:
Hello World
function lovr.draw(pass)
pass:text('Hello World!', 0, 1.7, -3, .5)
end
Spinning Cube
function lovr.draw(pass)
pass:cube(0, 1.7, -1, .5, lovr.timer.getTime())
end
Hand Tracking
function lovr.draw(pass)
for _, hand in ipairs(lovr.headset.getHands()) do
pass:sphere(vec3(lovr.headset.getPosition(hand)), .1)
end
end
3D Models
function lovr.load()
model = lovr.graphics.newModel('model.gltf')
end
function lovr.draw(pass)
pass:draw(model, x, y, z)
end
More examples are on the docs page.
Building
You can build LÖVR from source using CMake. Here are the steps using the command line:
mkdir build
cd build
cmake ..
cmake --build .
See the Compiling Guide for more info.
Testing
Tests can be found in the test/lovr directory.
You can run all of LÖVR tests from the command line with the following:
./build/bin/lovr test
To run tests for a single module, pass the name of the module as an argument (e.g. this runs the tests for the data module):
./build/bin/lovr test data
Resources
- Documentation: Guides, tutorials, examples, and API documentation.
- FAQ: Frequently Asked Questions.
- Matrix: The LÖVR community for discussion and support.
- Nightly Builds: Nightly builds for Windows.
- Compiling Guide: Information on compiling LÖVR from source.
- Contributing: Guide for helping out with development 💜
- LÖVE: LÖVR is heavily inspired by LÖVE, a 2D game framework.
License
MIT, see LICENSE for details.