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

157 commits

Author SHA1 Message Date
bjorn 74325d81a1 Expose runtime name in lovr.headset.getDriver; 2023-07-10 19:35:21 -07:00
bjorn 0d30055dd7 webgpu/wasm updates;
Some compile fixes and a rename from gpu_wgpu to gpu_web, since wgpu
refers to a specific implementation of WebGPU and I'm really bad at
typing it for some reason.
2023-07-09 13:13:58 -07:00
bjorn 10c2c75482 Frustum culling;
- Adds Pass:setViewCull to enable/disable frustum culling.
- Renames Pass:setCullMode to Pass:setFaceCull (with backcompat).

Some stuff currently missing:

- Text is not culled, but should be.
- VR view frusta are not merged yet.
2023-07-07 14:51:22 -07:00
bjorn 6e018b8c96 Replace HeadsetOrigin with 'seated' flag;
Origin type used to be a query-able property of the VR system that
indicated whether the tracking was roomscale or seated-scale.

The t.headset.offset config value could be used to design an
origin-agnostic experience, which by default shifted content up 1.7
meters when tracking was seated-scale.  That way, stuff rendered at
y=1.7m was always at "eye level".  It worked pretty well.

It's getting replaced with a t.headset.seated flag.

- If seated is false (the default), the origin of the coordinate space
  will be on the floor, enabling the y=1.7m eye level paradigm.  If
  tracking is not roomscale, a floor offset of 1.7m will be emulated.
- If seated is true, the origin of the coordinate space will be y=0
  at eye level (where the headset was when the app started).  This is
  the case on both roomscale and seated-scale tracking.

So basically 'seated' is an opt-in preference for where the app wants
its vertical origin to be.

One advantage of this is that it's possible to consistently get a y=0
eye level coordinate space, which was not possible before.  This makes
it easier to design simpler experiences that only need to render a
floating UI and don't want to render a full environment or deal with
offsetting everything relative to a 'floor'.  This also makes it easier
to implement hybrid VR+flatscreen experiences, because the camera is at
y=0 when the headset module is disabled.

The opt-in nature of the flag, coupled with the fact that it is
consistent across all types of tracking and hardware, is hopefully a
more useful design.
2023-06-28 16:38:36 -07:00
bjorn 3f0dbeb595 Add lovr.headset.stopVibration; 2023-06-27 20:45:44 -07:00
bjorn 98729912a8 Add GL_EXT_samplerless_texture_functions; 2023-06-24 14:00:22 -07:00
bjorn 116d14cdf8 Details; 2023-06-24 11:26:09 -07:00
bjorn 97cc7d9137 Fix issue with blend shape compute shader;
It was only copying the raw vertex data for the first blend shape,
not the first blend shape in each group.
2023-06-20 21:42:44 -07:00
bjorn 4ec065757d Optimize blendshapes;
To initialize the vertices to their default state, it's way faster to
use a branch in the compute shader rather than using a copy.
2023-06-17 17:14:00 -07:00
bjorn a723ec7c5c Update error screen;
The error screen uses an orthographic projection when rendered in a
window, so the text is always the same size instead of scaling with the
window size.

Also you can close it with escape.
2023-05-12 17:16:22 +01:00
bjorn 61fe0f3bc0 Default errhand uses transparent background in AR; 2023-05-12 14:31:31 +01:00
bjorn 776a709de1 nogame: quit on escape; 2023-05-12 14:30:47 +01:00
bjorn b8a8aa2755 nogame: only set background color in VR; 2023-05-12 14:28:53 +01:00
bjorn 264bfdeadf Use lovr.system.pollEvents in lovr.errhand; 2023-05-10 18:14:09 +01:00
bjorn 211c29e8c2 rm oculus openxr loader;
As of v51, Quest works with the official OpenXR loader.
2023-05-10 18:14:09 +01:00
bjorn da107f4387 Rename lovr.event.pump to lovr.system.pollEvents; 2023-05-10 18:14:09 +01:00
bjorn 027dd0563b Fix seam in equirect shader; 2023-05-10 18:14:09 +01:00
bjorn 20a331cb93 Fix equirect shader orientation; 2023-05-10 18:14:09 +01:00
bjorn 43e796acd1 Fix --graphics-debug; 2023-05-03 23:08:45 -07:00
bjorn c717670a80 Add --graphics-debug command line argument; 2023-05-03 20:54:19 -07:00
bjorn 452ee5c7c6 Pass rework;
Pass stores draw commands rather than sending them to Vulkan
immediately.

The main motivation is to allow more flexibility in the Lua API.  Passes
are now regular objects, aren't invalidated whenever submit is called,
and can cache their draws across multiple frames.  Draws can also be
internally culled, sorted, and batched.

Some API methods (tallies) are missing, and there are still some bugs to
fix, notably with background color.
2023-05-02 00:06:01 -07:00
bjorn f98306e786 rm transfer passes; rm Tally for now;
- Add Buffer:newReadback
- Add Buffer:getData
- Buffer:getPointer works with permanent buffers
- Buffer:setData works with permanent buffers
- Buffer:clear works with permanent buffers
- Add Texture:newReadback
- Add Texture:getPixels
- Add Texture:setPixels
- Add Texture:clear
- Add Texture:generateMipmaps
- Buffer readbacks can now return tables in addition to Blobs using Readback:getData

Tally is coming back soon with an improved API, it's temporarily removed
since it made the transfer rework a bit easier.

Note that synchronous readbacks (Buffer:getData, Texture:getPixels)
internally call lovr.graphics.submit, so they invalidate existing Pass
objects.  This will be improved soon.
2023-04-29 18:31:03 -07:00
bjorn 6862b8c970 Change cofactor/normal matrix to mat3;
This means per-draw uniform data is 128 bytes now!
2023-04-27 20:22:31 -07:00
bjorn 8f654ed408 Simplify fill shaders;
Now there's 2 instead of 3!  Behavior is the same, fill goes
layer-by-layer onto each view until either the texture or canvas run out
of layers.
2023-04-26 22:18:06 -07:00
bjorn 6c252a47b8 Don't declare builtin flags in compute shaders;
They aren't used, and increase file size and clutter up disassembly.
2023-04-05 21:53:39 -07:00
bjorn 747c7fdddf Optimize blend shape shader;
This is ~20% faster, I think it's because all the SSBO stores are
"batched" at the end.
2023-04-05 21:53:39 -07:00
bjorn a2b12c9e7c Vertex tangents don't require normalMap flag anymore; 2023-03-31 19:23:20 -07:00
bjorn ff10461e69 Reduce blend shape chunk size from 128 to 64; 2023-03-31 18:45:16 -07:00
bjorn f56b48b3a7 Blend shapes and skinning work at the same time; 2023-03-31 18:45:16 -07:00
bjorn 4a6de6caf5 Write blend shape compute shader; Bugfixes; 2023-03-31 18:45:16 -07:00
bjorn 530db8c7f8 WIP blend shape compute dispatch; 2023-03-31 18:45:16 -07:00
bjorn 6de1c624b4 Scope shader macros by the stage they're valid in;
Leads to better error messages if you try to use e.g. DefaultPosition in
a fragment shader.
2023-03-02 19:03:15 -08:00
bjorn abbc6a6dc6 Merge branch 'master' into dev 2023-02-21 21:12:33 -08:00
Bjorn d1eaa43997
Merge pull request #641 from brainrom/pkgrename
Android package rename via CMake
2023-02-05 21:57:25 -08:00
bjorn 89edccbf4c Add lovr.headset.isPassthroughEnabled and lovr.headset.setPassthroughEnabled; 2023-02-05 19:51:12 -08:00
bjorn 7027defe3c rm attachmentCount shader flag;
It doesn't work as intended (due to glslang issues?).  The current way
to write a shader that uses multiple attachments is to declare multiple
output variables, which is a little better because you can name them
however you want and customize the type.

It would be nice to be able to support a "void" entrypoint for multiple
attachments so you don't need to awkwardly return the first target's
color, but I can't find a way around this right now.
2023-02-05 16:04:17 -08:00
bjorn bf31072d0d Cleanup; 2023-01-30 19:44:23 -08:00
Ilya Chelyadin d84d358de7 Minor fixes 2023-01-31 06:03:53 +03:00
kokokoshka 85b6e36020 Android package rename via CMake 2023-01-30 20:35:49 +03:00
Ilya Chelyadin ac012d39c2 Universal APK for Oculus, Pico and Generic loaders 2023-01-05 01:50:38 +03:00
Ilya f3837d99fd
Merge branch 'bjornbytes:master' into picofix 2023-01-04 23:03:54 +03:00
bjorn b6d8546a6f Merge branch 'master' into dev 2023-01-02 16:46:55 -08:00
bjorn fe353ea243 Fix default lovr.log printing gsub result; 2022-12-30 21:40:27 -08:00
bjorn d438578c42 CMake: Windows includes lovrc.bat in builds;
Also made a nifty helper function to move resources to the build folder,
in an effort to avoid writing duplicate versions of these functions for
each platform.
2022-12-30 21:20:27 -08:00
bjorn c81a356799 Compress monkey more;
Its face is smooth now, which looks better, is somewhat better for
testing, and saves 8kb.
2022-12-29 20:33:49 -08:00
bjorn dc93920816 Fix monkeycrush index;
There was a bugfix that makes model vertex indices 1-based.
2022-12-29 20:33:49 -08:00
Ilya Chelyadin f62c99e469 Fix typos, indentation, minor issues 2022-12-08 07:05:30 +03:00
Ilya bd767092f3
Merge branch 'bjornbytes:master' into picofix 2022-12-07 19:50:13 +03:00
Bjorn 78a70670bb
Merge branch 'dev' into MSFT_controller_model 2022-12-03 19:34:49 -08:00
bjorn a615351f66 Actions; Sponsors; README; 2022-12-02 18:14:31 -08:00