Commit Graph

377 Commits

Author SHA1 Message Date
Nevyn Bengtsson 0265babef4 Android: Ask for permissions on demand
By looking for failed start and requesting then;
and then emitting a new event type when
permission has been granted or rejected;
and then using that event in the default
boot.lua to re-start capture.
2021-02-08 16:08:29 -07:00
Nevyn Bengtsson a941c5b02a record audio permission in manifest 2021-02-08 16:08:29 -07:00
Nevyn Bengtsson 2a3526bcd7 Android: Ask for audio permissions on startup
Will change this to ask on demand in an upcoming commit
2021-02-08 16:08:29 -07:00
Nevyn Bengtsson e54629dfb0 Android: Link appcompat so we can ask for audio capture permissions 2021-02-08 16:08:29 -07:00
Nevyn Bengtsson 8403c9bd70 just a super dummy spatializer 2021-02-08 16:08:29 -07:00
bjorn c92b47e3a6 Another miniaudio attempt WIP; 2021-02-08 16:08:29 -07:00
bjorn 709a41a352 Do more rendering work when lovr.draw is missing;
- The lovr.headset.renderTo callback can now be nil, causing an empty frame to be submitted to the compositor.
- lovr.mirror will still be called if lovr.draw is nil.  This means the window will be (correctly?) cleared to the background color now if lovr.draw is nil.

This prevents runtimes from thinking the app is missing/unresponsive when lovr.draw is absent.  To get the old behavior, just don't call lovr.headset.renderTo.
2021-02-05 15:03:06 -07:00
bjorn 0cb8a004d3 webxr.js: update emscripten dynCall syntax; 2021-01-25 14:02:15 -07:00
bjorn 24484f3930 Fix lovrInstanceID on Android; 2021-01-25 13:10:25 -07:00
bjorn 522987c211 64 bit nightly builds; 2021-01-08 21:26:03 -07:00
bjorn f1a5887133 WIP holographic_controller bindings; 2021-01-08 21:18:03 -07:00
Bjorn 10cc0011a5
Merge pull request #338 from bferguson3/master
Removed erroneous manifest entry
2020-12-28 15:55:48 -07:00
bjorn 3f975bcc8f Android plugin support;
- Link against dl (this was probably why ffi.load didn't work)
- Store shared libraries in the apk uncompressed
  - Libraries are added during the "package" aapt call instead of "add".
    - Because -0 (used to store uncompressed) only works during package.
    - classes.dex is added here too now.
    - There's only one aapt invocation now, which is kinda nice.
  - The lib folder needs to be in a subfolder now ("raw" was chosen).
    - Because "package" and "add" subcommands work differently.
  - Store shared libraries in the apk page aligned
    - Required passing -p to the zipalign invocation.
    - This is needed because dlopen("zip!path") needs it.
  - android:extractNativeLibs="false" is added to the XML manifest.
  - apk sizes are bigger, but disk usage and install time should improve.
- Fix a bug with moving plugin libraries into the lib folder with CMake.
- Use lovrFilesystemGetSource instead of lovrFilesystemGetExecutablePath
  to get the proper path to the apk.
2020-12-28 14:45:56 -07:00
bjorn 8ef50b5f6a lovr.mirror: don't call lovr.headset.getMirrorTexture twice; 2020-12-02 14:46:37 -07:00
Piotr Łabuda f60441d905 Reverting binding to base 2020-11-27 21:06:26 +01:00
Ben Ferguson 0ef23bb7e2 Removed erroneous manifest entry 2020-11-23 16:21:22 -05:00
bjorn 1ff94bc29a Default errhand agnostic to t.math.globals; 2020-11-20 19:23:42 -07:00
Piotr Łabuda d65c72d7c6 Added bindings to pose/base 2020-11-21 00:37:32 +01:00
bjorn ad42609b1d Support Vive Trackers; 2020-11-19 00:39:38 -07:00
Nevyn Bengtsson 220aa70d7c fix crash in error handler when running out of vectors 2020-11-18 21:38:04 +01:00
Ben Ferguson 63a141dc54 Add Quest 2 90hz to android manifest 2020-11-14 09:21:01 -05:00
bjorn 43d5bc78f0 lovr.mirror disables blending when drawing headset texture;
This is so transparent headset textures (when rendering overlays)
don't ghost.  Alternatively, clear could be used.
2020-11-12 18:08:05 -07:00
Nevyn Bengtsson a321d997a1
network permissions for pico too 2020-11-01 22:54:02 +01:00
Ben Ferguson efe143bf55 enet and hand tracking permissions fix 2020-11-01 16:43:03 -05:00
bjorn 85cc82d8cb v0.14.0; 2020-10-05 16:40:27 -06:00
bjorn 98f481e941 WebXR input fixes; 2020-10-02 15:57:42 -06:00
Nevyn Bengtsson da79a87328 Allow lovr.headset.init to fail
with a pcall, like the requires above. so if there
is no matching headset driver, the module is just
turned off.
2020-10-01 22:43:57 +02:00
bjorn e14db6c671 Fixes from webxr testing; 2020-09-29 23:41:42 -06:00
bjorn f70201240a nogame fix; 2020-09-29 22:24:40 -06:00
bjorn f7476416ab nogame; 2020-09-25 17:08:51 -07:00
bjorn caca0ef71c t.headset.supersample;
Can be used to change the size of the headset texture that gets
submitted to the VR runtime.  It can be a boolean or a number.
2020-09-25 15:41:30 -07:00
bjorn f1447fd69a lovr.graphics.get/setViewPose; lovr.graphics.get/setProjection; 2020-09-24 19:03:37 -07:00
bjorn 92ef5ee02d Fix lovrInstanceID on non-singlepass setups; 2020-09-19 17:33:49 -07:00
bjorn 77083d06af Update nogame; 2020-08-30 21:48:47 -06:00
bjorn 28144c8143 OpenXR Android stuff; 2020-08-29 19:45:52 -06:00
bjorn 7617da0ec1 Move headset initialization to lovr.headset.init;
OpenXR basically has a hard requirement that a graphics API is available
before its session can be created.  Currently the graphics module isn't
always around when headset initialization takes place.  Polling the
graphics availability in update/renderTo has some consequences for calls
made to the headset module in lovr.load or during the first few frames.

So instead we're going to delay headset initialization to a special
function that is called after modules are required.  It can also be
called manually if the window creation is delayed.
2020-08-26 13:42:42 -06:00
bjorn 5ab8dffd8d Fix OpenXR axis actions;
2D axes can't be used as 2D actions and instead need to be represented
as two 1D axes.  Also fixup oculus touch / valve index action paths.
2020-08-23 16:11:20 -06:00
bjorn ba3d10dd60 OpenXR: Make action names snake case;
Capital letters are not valid for action names.
2020-08-23 15:33:02 -06:00
bjorn 0439c932ce openxr: Move actions into resources; 2020-08-22 15:40:52 -06:00
bjorn 3cb291c866 rm leap motion driver;
Planning on using the new Ultraleap OpenXR API layer.  It's possible
that this will be added back if that doesn't work out.
2020-08-22 14:05:40 -06:00
bjorn e50835260a Clean up WebXR;
- Pointer lock
- wasPressed/wasReleased
- Cleanup
2020-08-21 04:37:38 -06:00
bjorn 6cadcea65d WebXR updates;
- Make the renderloop synchronous by hijacking the RAF to run on the
  XRSession when active.
- Convert os_web to use emscripten's native HTML5 interface instead
  of going through GLFW.
- Stop using preinitialized GL context -- lovrPlatformCreateWindow
  now creates the context.
- GLES2/3 emulation is not necessary.
- Remove inline sessions.  The VR simulator is used to render to the
  Canvas instead.  webxr_attach and webxr_detach are used to replace
  replace the active headset driver with the webxr driver when an
  immersive session starts.
- Add noop desktop_getSkeleton.
2020-08-20 13:28:07 -06:00
bjorn 6fd80d10a1 rm unused window argument in errhand; 2020-08-19 14:01:31 -06:00
bjorn 1ca7aeb94e Reset font pixel density in errhand; 2020-08-18 21:15:31 -06:00
bjorn 65470f1e0e Update webxr driver; rm webvr; 2020-08-16 00:31:20 -06:00
bjorn cb4281b889 Add keypressed and keyreleased events; rm t.hotkeys; 2020-08-06 19:19:45 -06:00
bjorn c20c5508b4 vrapi: lovr.headset.newModel and lovr.headset.animate; 2020-08-06 18:00:54 -06:00
bjorn 7e941cd22f lovr.headset.animate; Animated OpenVR controller models;
- lovr.headset.newModel accepts an optional options table as the
  second argument.  There is currently a single option named
  'animated' that can be used to request an animatable model.
  Currently it isn't clear if this should be a hint or not.
- lovr.headset.animate (name pending) can be called with a device
  and a model (usually with an animated model from headset.newModel,
  but this is not required).  The function attempts to animate the
  Model to match the pose of the device in an opaque driver-specific
  way, and returns whether or not this was successful.
- OpenVR has models for controllers with a system called "components"
  that can be used to animate the individual buttons.  Now the OpenVR
  headset driver implements the 'animate' function to make use of the
  controller components, to easily load and render animated controllers.
2020-08-05 15:05:59 -06:00
bjorn 86fee211f1 Default errhand implementation handles restart event; 2020-08-04 12:21:38 -06:00
Bjorn 617d508d68
Merge pull request #269 from jmiskovic/savemount
Config parameter for save directory precedence
2020-07-29 16:26:07 -06:00
bjorn d4f88f3d8d lovr.log: strip trailing newline in default implementation;
GL debug messages sometimes have newlines...
2020-07-29 14:24:57 -06:00
bjorn e3aa4c7d5d t.graphics.debug flag; 2020-07-28 16:12:15 -06:00
bjorn 55f66f217e Adjust pico SDK version to 27; 2020-07-27 17:09:16 -06:00
bjorn ac58a1aeba Pico: Draw the rest of the owl;
Add entrypoints, headset backend code, fill in the Activity, and
add various special cases to account for the asynchronous render loop,
lack of sRGB support, and OpenGL state resets.
2020-07-27 14:56:21 -06:00
bjorn e7d4e6cf7b Start pico headset backend; 2020-07-27 13:58:52 -06:00
bjorn d25e20fb9d mv AndroidManifest.xml AndroidManifest_vrapi.xml; 2020-07-27 13:47:32 -06:00
bjorn 87b979f51c mv Activity.java Activity_vrapi.java; 2020-07-27 12:50:27 -06:00
bjorn 9abed055d8 lovr.log;
lovr.log is a new callback that is invoked whenever LÖVR wants to
send the project a message.  For example, this could be a performance
warning from the graphics module, an error message from one of the
headset backends, or an API deprecation notice.

The callback's signature is (message, level, tag).  The message is a
string containing the message to log, level is a string that is currently
one of "debug", "info", "warn", "error", and tag is an optional string
that is used to indicate the source of the message for grouping purposes.

The default implementation of the callback just prints the message,
but the callback can be overridden to do things like filter messages,
write them to a file, or even render them in VR.  Projects can also
invoke the callback directly to log their own messages.
2020-07-06 16:20:55 -06:00
bjorn a9aaedae61 rm oculusmobile from t.headset.drivers;
Replaced by vrapi
2020-07-02 20:17:09 -06:00
bjorn 27b04b2bde vrapi: Add support for focus awareness; 2020-06-25 15:00:12 -06:00
bjorn 8b281d56e3 Android: Organize tup rules; Fix manifest; 2020-06-25 13:27:18 -06:00
Josip Miskovic 66d7e887c7 Config parameter for save directory precedence 2020-06-21 18:02:36 +03:00
bjorn a1aa3c8ae8 Finish vrapi driver; 2020-06-09 18:02:03 -06:00
bjorn b34c03bcc8 Tup build system for android; 2020-06-09 18:02:03 -06:00
bjorn 680dc00b5b rm menu button from oculus touch bindings;
Saw an error about this in logs, let's see if it fixes touch controllers.
2020-05-11 18:04:37 -06:00
bjorn 9ba814fe3f omg; 2020-05-04 17:30:41 -06:00
mcc b5e72d8bd9 Restart cookie minor changes for PR review 2020-04-16 10:57:13 -04:00
mcc fbcce7fc59 Reworked quit/restart events (compatibility break)
Based on Slack conversation, the following changes:
- lovr.event.quit("restart") no longer supported
- lovr.event.quit no longer takes restart "cookie"
- When lovr.event.restart() called, lovr.quit() is not called, instead lovr.restart() is called
- Value returned from lovr.restart(), when called, becomes the cookie
- lovr.event.quit takes the lovr.event.quit() return code as an argument

lovr.run() is unchanged, it still returns (exit code | "restart", cookie).
2020-04-16 00:32:54 -04:00
bjorn aed0499c5f Add oculus_touch to action manifest; 2020-04-02 22:47:36 -06:00
bjorn 6f6de92d19 Add preliminary WebXR backend; 2020-03-04 22:47:24 -08:00
bjorn 90b605f012 Add restart cookie; lovr.event.restart; arg.restart; 2020-02-26 14:40:40 -08:00
Bjorn 2f78c29c07
Merge pull request #128 from mcclure/jun28-upside-down-mirror
Y-flip mirror texture on Oculus
2020-02-17 18:02:37 -08:00
mcc 6536216aa2 Fix lovr.graphics.skybox() 2020-02-17 18:19:05 -05:00
bjorn 7f205d2fb1 WebGL shader fix; 2020-02-16 01:32:07 -08:00
bjorn d2f4628791 Add pointer devices; 2020-02-14 19:10:37 -08:00
bjorn 155718d161 shaders: Change abstract parameters to named parameters; 2020-02-11 16:17:54 -08:00
bjorn c502f5b62a Add highp shader flag that sets default fragment precision to highp;
Also, precision qualifier is required to work on desktop GL, so
we don't need ifdefs for it!
2020-02-07 19:44:51 -08:00
bjorn cae8bba522 Remove lovrMain macro;
We want lovrMain to be the entrypoint but we can't figure out how
to do this in a way that wouldn't break things, on all platforms.
2020-02-07 19:25:55 -08:00
Cassie Jones 9845fee2b6 Use different compute #version with OpenGL ES
GLES doesn't like #version 430 for compute, it wants #version 310 es.
We can conditionally compile that.
2020-01-31 06:24:08 -05:00
bjorn a1a53b4bed sampler2DMultiview; textureMultiview; 2020-01-30 17:48:15 -08:00
bjorn 0aa724116e Headset views;
- lovr.headset.getViewCount
- lovr.headset.getViewPose
- lovr.headset.getViewAngles
2020-01-27 22:11:58 -08:00
bjorn 4f7bb9e53e lovr.headset.wasPressed; lovr.headset.wasReleased; 2020-01-24 22:48:36 -08:00
bjorn c7f5406ce2 Make clipping planes consistent across most headset drivers;
The default far clipping plane was changed from 30 to 100 for openvr
and oculus.  oculus_mobile clipping planes can't be changed easily.
2020-01-23 11:25:38 -08:00
bjorn d228dc95d7 Automatically convert binary resources;
- Teach CMake how to compile binary resources to C headers, like xxd.
- Note: tup is already using xxd to do this.
- gitignore binary resource headers to reduce git noise and avoid problematic
  interactions between git and build systems.
2019-12-29 11:25:30 -08:00
bjorn a5db2d6c5c mv appveyor config to resources folder; 2019-12-28 20:13:19 -08:00
mcc c563787f7d Android fixes. Major change is lovrMain() {} is now lovrMain {}
The oculus drivers choke on #define lovrMain()
2019-12-17 20:20:09 -05:00
bjorn 6f24da9f7f Rework Tupfiles;
- One toplevel Tupfile that makes it more clear what happens.
- Add config flags for -Werror, -fsanitize, and separate debug/optimize flags.
- Automatically integrate with libs built by CMake (build folder, rpath, libs folder).
- Disabling modules actually works, only the stuff that's needed is built.
2019-12-13 06:52:57 -08:00
bjorn 488c125c5f Draw the rest of the owl; 2019-12-10 12:19:50 -08:00
bjorn 898a3f9f35 rm double underscores from glsl;
This naming pattern is reserved.
2019-11-28 15:25:19 -08:00
bjorn b69a5ba1a3 Update conf.version;
opps
2019-11-27 20:48:58 -08:00
bjorn 6ad2d8ccef Add lovrMain macro to shaders (no breaking change); 2019-11-18 23:20:08 -08:00
bjorn e32c3ea2df v0.13.0; 2019-10-14 18:21:07 -07:00
bjorn f6cd8120ad Add macOS bundle resources; 2019-10-14 15:23:46 -07:00
bjorn 8c0ae3fbb3 More WebVR (controller) fixes; 2019-10-09 14:54:07 -07:00
bjorn 17dda66b69 boot.lua works without headset module; 2019-10-02 16:20:50 -07:00
bjorn f82bcb703b Finalize skeletal input API; 2019-09-18 16:12:08 -07:00
mcc 38f4204661 Make lovrViewID signed on Oculus Mobile
The "mask" example was failing on Oculus Mobile on the line of glsl:
if (lovrViewID == 1) {
because lovrViewID was unsigned and 1 was signed. One way to fix this would be to replace 1 with 1u as that is unsigned, but this would be the wrong fix because lovrViewID is in fact signed on all platforms other than Oculus Mobile. lovrViewID was depending on platform defined to either gl_ViewportIndex (signed), a signed uniform, or gl_ViewID_OVR (unsigned). The solution is to place an explicit cast in the multiview definition of lovrViewID so that it is signed on all platforms.
2019-09-11 18:22:06 -04:00
bjorn 5ed132635a Fix error screen when headset module is disabled; 2019-09-03 15:34:41 -07:00
bjorn 39376a10d5 normalTexture -> normalMap; 2019-08-31 05:31:20 -07:00
bjorn 9ea785d210 Fix normal matrix;
Now that lighting is in world space.
2019-08-31 03:00:54 -07:00