Commit Graph

4838 Commits

Author SHA1 Message Date
Bjorn 01d3136e73
Merge pull request #696 from SpookySkeletons/master
feat: overlay layers
2023-08-21 15:06:53 -07:00
Bjorn f8f9c833b1
Merge branch 'dev' into master 2023-08-21 14:59:53 -07:00
bjorn 2d94841db6 Pass:skybox takes nil; 2023-08-21 14:37:05 -07:00
BabbleBones 6fbfc16f7d feat: overlay layers 2023-08-18 11:30:58 -04:00
bjorn 6f566f2125 Show a message box when Vulkan initialization fails on Windows; 2023-08-17 15:02:53 -07:00
bjorn 0d6c9a1def World:isCollisionEnabledBetween takes nils;
They act like wildcards, just like nil tags do otherwise.
2023-08-15 18:24:19 -07:00
bjorn b1deeda0ce Fix issue with buffer recycling; 2023-08-15 10:18:48 -07:00
bjorn b643f3b695 Fix Tupfile; 2023-08-15 09:56:00 -07:00
bjorn b77212b49e Use ubuntu 20.04 for CI;
22.04 was necessary for a while due to glslang version, but now we are
building and using the submodule'd glslang CLI.
2023-08-14 17:47:17 -07:00
bjorn 003d69ea94 Make Surface more flexible;
- Add newSurface, which returns a "blank" surface, allowing you to set
  your own properties.
- Add finalizeSurface, which sets computed surface properties and clamps
  values to prepare for lighting.
- Add applyMaterial, which takes all of the properties in the material
  and applies them to a surface
- Add helper functions for getting properties from the Material, which
  combine scalar factors and texture samples while respecting shader
  flags:
  - getMaterialBaseColor
  - getMaterialEmissive
  - getMaterialMetalness
  - getMaterialRoughness
  - getMaterialOcclusion
  - getMaterialClearcoat
  - getMaterialClearcoatRoughness
- Add getDefaultSurface, which returns what initSurface would result in
  today, deprecating initSurface.
2023-08-02 18:11:36 -07:00
bjorn 339e6cf94b Shrink DrawData from 128 to 64 bytes!;
- Last row of transform matrix is unused, make it 4x3
  - Requires funny row-major packing due to vec3 std140 padding.
  - Teach spirv parser to tolerate non-square matrix types, though
    they aren't supported anywhere else yet.
- Compute cofactor in shader for normal matrix, ALU is free,
  optimize out many terms, rm maf_cofactor.
- Take out complex UBO alignment logic since stuff is PO2 these days.

This was a common bottleneck for some workloads, so there are measurable
performance gains (up to 2x faster pass submission on CPU).  GPU time is
identical, at least on desktop.
2023-08-01 18:57:09 -07:00
bjorn 90994d023a tup: Add -DdNODEBUG to ode for release builds; 2023-08-01 00:21:32 -07:00
bjorn 036957da23 Update ode submodule;
Includes adding the dNODEBUG option in release builds and a fix for
box-sphere collisions.
2023-08-01 00:21:32 -07:00
bjorn 874f438621 Add back lovr.headset.getDirection;
It's useful.  quat(lovr.headset.getOrientation()):direction() is
verbose, noob-unfriendly, and somewhat wasteful.  I think this was
originally removed because something about not exposing the full
rotation basis.
2023-07-31 18:38:04 -07:00
bjorn 715edfd431 Add hand/*/pinch and hand/*/poke devices; 2023-07-31 18:30:35 -07:00
bjorn 5fddd28137 Add hand/left/grip and hand/right/grip devices; 2023-07-31 18:08:56 -07:00
bjorn c6cb5451ee Set XR_LOADER_DEBUG environment variable to none;
LOVR doesn't require OpenXR to run.  When the headset module is enabled
and the openxr headset driver is enabled, LOVR tries to initialize
OpenXR, and if it fails then it will try the next driver.

The OpenXR loader will print error messages to stderr by default.  This
is undesirable because someone who is unfamiliar with OpenXR will see a
bunch of messages in their console that say "ERROR" and think something
is wrong, even though the messages are innocuous and don't indicate an
actual problem.

The only way to silence these messages from the OpenXR loader, to my
knowledge, is to set the XR_LOADER_DEBUG environment variable to 'none'.
This is only done when the environment variable isn't set, so it's still
possible to set XR_LOADER_DEBUG to see the logs.
2023-07-31 17:32:31 -07:00
Bjorn c38165a154
Merge pull request #688 from bjornbytes/mesh
Mesh
2023-07-29 18:21:01 -07:00
bjorn 0fe80e4ef9 CMake: recompile shaders when lovr.glsl changes; 2023-07-29 13:36:52 -07:00
bjorn 53ae77f123 Merge branch 'master' into dev 2023-07-29 03:40:36 -07:00
bjorn 072452a4da Fix issue where OBJ UVs are upside down;
Most OBJ loaders use OpenGL texture coordinate conventions.

After switching to Vulkan, the UV origin became upper-left and images no
longer needed to be flipped on import.  This means that the OBJ importer
now needs to flip its UVs to compensate.  Somehow, no one noticed until
now!  Most people are using glTF I guess.
2023-07-29 03:37:18 -07:00
bjorn 2f90255d1a physics no longer depends on maf;
So little is used, may as well make it more self-contained.
2023-07-28 16:16:14 -07:00
bjorn 4892d228b3 WIP; 2023-07-24 15:34:44 -07:00
bjorn f960141fd7 Add :type method to vectors; Change Mat4 __tostring; 2023-07-24 15:12:25 -07:00
bjorn 941918152a Merge branch 'master' into dev 2023-07-24 14:52:35 -07:00
bjorn 2dcba24138 Update README;
Don't trick people into thinking WebXR is supported right now,
and spell macOS better.
2023-07-24 14:52:00 -07:00
Bjorn fd49a4a287
Merge pull request #687 from xiejiangzhi/world_query_early_exit
World query early exit
2023-07-20 17:15:58 -07:00
xiejiangzhi ee10e22402 World query: Rename should_stop to shouldStop, early stop queryCallback if no give a callback 2023-07-21 08:00:58 +08:00
xiejiangzhi 91e586bbd4 Fix early exit logic for raycast & querySphere 2023-07-20 16:46:40 +08:00
xiejiangzhi a4dc1d9ffb Support early exit for world:raycast world:queryBox world:querySphere 2023-07-20 16:34:56 +08:00
bjorn 5c322d3403 Include temp buffer offset in draw range; 2023-07-17 18:45:37 -07:00
bjorn 534d47904e World:queryBox/World:querySphere callback is optional;
They also return a bool indicating if any intersections occurred.
2023-07-17 13:23:57 -07:00
bjorn 9b7433c1de Add :type method to objects;
NYI for vectors.
2023-07-17 13:18:19 -07:00
bjorn cc67e06d3c Make keyboard input functions variadic; 2023-07-17 13:13:17 -07:00
Bjorn 8ac6c4dbb0
Merge pull request #685 from xiejiangzhi/get_set_shape_pose
Add getPose/setPose for shape. #650
2023-07-17 01:59:33 -07:00
xiejiangzhi 98ee9739b4 Fix luax_readquat for lovrShapeSetPose 2023-07-17 16:42:58 +08:00
bjorn 2e6f95f06a Fix errhand when headset module is disabled; 2023-07-17 00:10:02 -07:00
Bjorn b37c74c93b
Merge pull request #684 from xiejiangzhi/fix_boot_lua
Fix boot.lua without math.globals
2023-07-17 00:08:04 -07:00
xiejiangzhi c880ed529a Add getPose/setPose for shape. #650 2023-07-17 14:34:54 +08:00
xiejiangzhi 8542624895 Fix boot.lua without math.globals 2023-07-17 10:11:22 +08:00
bjorn 61ffd5716f Disable LOCAL reference space on SteamVR;
Recent SteamVR versions have bugs with it, especially after triggering a
recenter operation.

In SteamVR, recentering fires referenceSpaceChangePending for the LOCAL
space, then the STAGE space, then the LOCAL space again, all with
different changeTimes.  No poseInPreviousSpace is given.

Recreating the main reference space whenever this event is received
leads to strange, inconsistent issues.  Sometimes the local/stage spaces
end up on top of each other, other times one or both will be way up in
the air (putting the headset at negative y coordinates).

This bug is even present when recentering in the compositor, so it's not
an issue with lovr.  Cautiously disabling the local-floor emulation on
SteamVR runtimes and just always using the STAGE space until things are
sorted out.
2023-07-16 14:43:23 -07:00
bjorn 83d6e64c6e Use reference space change time when recreating reference spaces;
This doesn't fix any observed issue, but should be more correct.
2023-07-16 14:29:25 -07:00
Bjorn 01ac8ef8a4
Merge pull request #683 from jmiskovic/fix/mat4_mul_vec3_w
Restore w normalization in mat4:mul(vec3)
2023-07-15 12:33:37 -07:00
Josip Miskovic 1e475d122b Restore w normalization in mat4:mul(vec3) 2023-07-15 18:06:36 +02:00
bjorn b268cd1776 World:queryBox; World:querySphere; 2023-07-10 23:20:01 -07:00
bjorn 9bf2def86d Rename box shape dimensions to be more clear; 2023-07-10 23:11:14 -07:00
bjorn 5210d474b8 Source pitchable flag defaults to true; 2023-07-10 20:09:16 -07:00
bjorn 74325d81a1 Expose runtime name in lovr.headset.getDriver; 2023-07-10 19:35:21 -07:00
bjorn dabbd449a8 Format support considers both linear/srgb encodings; 2023-07-10 19:21:11 -07:00
bjorn be795c0ebd Change vec3 back to 3 floats; Clean up maf/vectors;
The "vec3 is 4 floats" thing was consistently confusing to people.  It's
reverted everywhere except for Curve.

maf now has full sets of methods for vec2/vec3/vec4, for consistency.

Vector bindings now use luax_readvec* helper functions for the
number/vector variants, and use maf for most functionality, which cleans
things up a lot.
2023-07-10 17:51:24 -07:00