1
0
Fork 0
mirror of https://github.com/bjornbytes/lovr.git synced 2024-07-02 12:33:52 +00:00
Commit graph

5075 commits

Author SHA1 Message Date
bjorn 8b5511efc4 Upgrade to OpenXR 1.0.30; 2023-09-21 22:20:27 -07:00
bjorn f2a9f8ec17 win32: use high resolution timer for sleeps; 2023-09-21 20:49:55 -07:00
bjorn 6eae891eb3 Add Mat4:getPose;
Companion to Mat4:getTranslation/Rotation/Scale;
2023-09-21 20:11:26 -07:00
bjorn 2a97fc0380 Vec3:transform; Vec4:transform; Vec3:rotate;
Co-Authored-By: Josip Miskovic <josipmiskovic@gmail.com>
2023-09-21 20:03:48 -07:00
bjorn b03e3244c3 LÖVR no longer requires 64KB uniform buffers;
Due to per-draw data size reduction from 144 -> 64 bytes.
2023-09-21 15:58:04 -07:00
bjorn 5a28acf5c4 macos: create metal layer; 2023-09-20 21:17:24 -07:00
bjorn f66ac0820c Fix Android probably; 2023-09-20 21:17:24 -07:00
bjorn 4e5d2c811d Install libX11-xcb-dev on actions; 2023-09-20 21:17:24 -07:00
bjorn 479983fede gpu: surface improvements;
Restores ability to open window after initializing graphics module.

Surface is created lazily instead of being required upfront.

Use native platorm handles instead of GLFW's callbacks.

Some minor reorganization around core/gpu present API and xr transitions.

Linux links against libxcb/libX11/libX11-xcb for XGetXCBConnection.
2023-09-20 21:17:24 -07:00
bjorn f35d5c9c70 Re-enable objective-c extensions on os_macos;
Locally this worked, but maybe CMake was stale.
2023-09-20 17:58:13 -07:00
bjorn c5793c2410 macos: replace remaining Objective C with C API; 2023-09-20 17:48:01 -07:00
bjorn f318c68796 Buffers can be cleared to values other than zero; 2023-09-18 23:05:27 -07:00
bjorn 38dbc46e8b Pass:append also copies draw bounding boxes; 2023-09-18 17:49:19 -07:00
bjorn ead7a0ccc1 Add backwards compat for lovr.headset.animate;
If the first argument is a string, it's ignored and the second is
expected to be a Model.  Otherwise, the usual single-argument path is
taken.
2023-09-18 17:31:28 -07:00
bjorn d7e7449e5a Fix message box;
oops I thought windows was already in graphics.c
2023-09-17 19:04:15 -07:00
bjorn c98f945cae rm os_window_message_box;
The message box is meant to be a hack to improve UX on Windows, not an
officially supported feature of core/os.  So it's more appropriate to
inline it in the one place/platform where it's used.
2023-09-17 17:22:08 -07:00
bjorn 181427eee4 glfw: filter resize events and cache window size;
GLFW reports window size as zero on Windows when the desktop window is
minimized.  This is by design.  Using zero width/height for window
textures isn't valid.  The fix is to ignore resize events where the
width or height is zero and also cache the last-valid window size so it
can be reported by os_window_get_size.  Sighs...
2023-09-13 18:56:06 -07:00
Bjorn ec8658f9ef
Merge pull request #702 from jmiskovic/fix/distance-joint-get-anchor
Fix getter for distance joint anchors
2023-09-13 15:21:31 -07:00
Josip Miskovic f16956b07d Fix getter for distance joint anchors 2023-09-13 22:06:51 +02:00
bjorn efbcdbfe8e Fix issue where Material:getProperties was returning uv shift as uv scale; 2023-09-12 01:11:49 -07:00
bjorn f2343a2056 Fix crash when uvShift/uvScale are tables; 2023-09-12 01:11:49 -07:00
bjorn f6216415e6 Rename pass memory stats to indicate they're CPU; 2023-09-11 20:19:36 -07:00
bjorn bfbde95bb2 Fix minor issues with Texture:clear bindings; 2023-09-11 20:11:31 -07:00
bjorn 5b6d882475 Add Image:mapPixel; 2023-09-11 18:48:46 -07:00
bjorn be213cc32d Cleanup; 2023-09-11 17:24:27 -07:00
bjorn 9542d46f33 Buffer format cleanup; 2023-09-11 03:01:11 -07:00
bjorn fe93018627 Fix issue with DrawData UBO size; 2023-09-11 00:35:26 -07:00
bjorn e99892218e Rebuild; 2023-09-10 16:35:23 -07:00
bjorn de268ef2d9 simulator: hand stays tracked while rotating;
It continues to use the mouse position of the click to compute the pose.
2023-09-09 12:29:32 -07:00
bjorn dbeff84bf4 Update lovr-http; 2023-09-08 01:08:26 -07:00
bjorn b4e78a6754 Add lovr-http plugin; 2023-09-08 00:11:01 -07:00
bjorn 942dc77b7a Pass Java VM to plugins on Android;
Currently I don't think there's a way for plugins to use JNI, because they
have no way to access the JavaVM or JNIEnv pointers.  JNI_OnLoad is only
called for native libraries loaded by Java, and the plugin library has
no way of loading liblovr.so or accessing its symbols because the
library is inside the APK.  This change emulates JNI_OnLoad as a means
of smuggling the JavaVM over to plugins before they're loaded.  On
Android API level 31, the JNI_GetCreatedJavaVMs function was exposed on
Android, so that may be an alternative for plugins to use in the future.
2023-09-06 21:48:49 -07:00
bjorn 5badf6d8db DPI fix; 2023-09-05 16:27:18 -07:00
bjorn 14cb2ed368 Add os_thread_attach/os_thread_detach;
These are called when creating/destroying Thread objects.  It's
currently only implemented on Android, where it attaches/detaches the
Java VM to the thread.  This allows JNI calls to be used on threads.

However I don't think e.g. `lovr.system.requestPermission` will work on
a thread yet, because it uses the global JNI env from the main thread
instead of the thread's JNI env.  Still, attaching/detaching the VM is
an improvement and will allow well-behaved JNI methods to work on
threads now.

I don't know how expensive this is, yolo.
2023-09-05 16:20:32 -07:00
bjorn 81e1c8fbad Add methods for accessing binary numbers from a Blob; 2023-08-28 10:31:32 -07:00
bjorn 78308acfa4 Fix Pass:capsule when its length is zero;
Just draw a sphere.  The transform is rotated so the sphere segments
line up better, because spheres and capsules use different orientations
for their sphere parts.  Also the "degenerate" z axis is reconstructed
to be perpendicular to the x/z axes.  This doesn't seem like it will be
particularly fast, but hopefully people aren't drawing zero-length
capsules too often.  There might be an opportunity to shortcut the
rotation since it's 90 degrees and would just involve swapping columns.
2023-08-22 20:36:17 -07:00
bjorn 0fcbdcbf5d Fixup overlay order;
- state.features.overlay should remain a bool since it just indicates
  whether the extension is supported/enabled.
- split the config value into a bool/u32 pair so the full u32 range can
  be used for the order (seems important to coordinate with other apps).
  - Also you can use a boolean now like before, which uses 0 as the order.
2023-08-21 15:15:39 -07:00
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