Commit Graph

3638 Commits

Author SHA1 Message Date
bjorn 63246d60aa Year; 2022-01-01 02:08:46 +02:00
bjorn 8462beef00 Fix/improve alpha cutoff;
The current flag did not work because float shader flags are not
supported.  It was also not very useful because it was per-shader
and did not use the alpha cutoff property of glTF materials.

Instead, let's turn the shader flag into an enable/disable boolean,
and add a scalar material property named "alphacutoff" that gets
read by the glTF importer.

When the alphaCutoff flag is enabled, the material property will be
compared against the pixel's alpha value to decide whether it should
get discarded.
2021-12-28 21:10:52 +02:00
bjorn 8d3d233e91 Include unknwn.h to fix OpenXR on some windows systems; 2021-12-27 15:16:50 +02:00
Nevyn Bengtsson 06dd81f6d7 Use d8 instead of dx
dx was deprecated years ago, and d8 replaces it. dx is
removed in build-tools 31, so it's best not to depend on it.

In addition, d8 now supports Java 11 (class version 55), which
is required to use the javac bundled with Android Studio.
2021-12-07 08:17:56 -08:00
bjorn e283245dc6 Remove suspicious friction override; 2021-11-12 12:20:21 -08:00
bjorn e1527a949a openxr: fix xrLocateViews call;
- The input parameter is a count, not a size
- The view structs must be initialized with a type
2021-10-24 13:03:05 -07:00
Josip Miskovic 8e64ded60a Check stbtt_GetGlyphBox() return status
Only use results of stbtt_GetGlyphBox() if they are valid. Fixes the
font rendering glitch when printing text with leading space character.
2021-10-24 11:21:16 -07:00
Josip Miskovic 09cc73a988 Move text measuring to Rasterizer 2021-10-21 10:42:11 -07:00
bjorn 0a2f968850 Fix circle uvs;
After changing circle scale from diameter to radius, the uvs broke,
since they are calculated from the position.
2021-10-09 03:52:11 -07:00
bjorn fe08dc3769 Fix Mesh:setVertices starting index wraparound crash; 2021-10-09 03:01:40 -07:00
bjorn 6b99862d3d Don't always force AMD mode to true!; 2021-10-03 15:31:29 -07:00
bjorn 48d98a701c Use WebGL buffer path on AMD GPUs;
AHHHHHHHHHHHHH
2021-10-03 15:31:17 -07:00
Josip Miskovic 015a2ed69c Accept number values in Vec2/3/4 operations
Vector methods are extended to receive vectors as individual numbers
for each of x,y,z,w component. The vector objects are still supported
as well.

Previously only single value scalar was supported. This change maintains
backward compatibility.

```
v = vec3():add( 1, 2, 3 )          -- both do the same
v = vec3():add( vec3(1, 2, 3) )    _/

v = vec4():mul( 2 )            -- x component is a default for y, z
v = vec4():mul( 2, 2, 2, 2 )   _/

v = vec2():lerp( 2, 2, 0.5 )        -- in lerp, dot, cross, distance
v = vec2():lerp( vec2(2, 2), 0.5 )  _/   all components are mandatory
```
2021-09-07 14:00:59 -07:00
bjorn a73be7cba0 Fix lovr.headset.getName on Quest 2;
The manifest was not properly marking Quest 2 as a supported device,
so Oculus was pretending to be a Quest 1.
2021-08-12 11:16:18 -07:00
bjorn 8ea24c266c vrapi: Fix recentering; 2021-08-07 09:27:58 -07:00
bjorn 703104c4d1 Fix pico build; 2021-08-04 11:05:29 -07:00
bjorn e2cad4ed81 Fix crash in Material:setTexture; 2021-07-10 09:42:49 -07:00
bjorn f959770396 Add missing OpenVR pointer actions; 2021-06-29 13:09:57 -07:00
bjorn 63320252a1 Fix error when rapidly recreating objects;
If you create and destroy objects quickly (using :release), malloc
might give you the same pointer.  When we look up this pointer in
the userdata cache, it'll give you an invalid Proxy/pointer, which
throws an error like "Calling 'fn' on bad self".

When collecting objects, remove them from the userdata cache.
2021-06-26 14:41:42 -07:00
bjorn 4125796211 Fix shaders with nil stages;
The length was getting kept as zero, need to adjust length when
falling back to default shaders.
2021-06-21 10:22:15 -06:00
Jakob Bornecrantz 93d867a972 Fix AppImage lovr.desktop file
Changes by @darltrash
2021-06-18 15:53:31 -06:00
bjorn 92a08c326f vrapi: getViewPose returns a pose when position is invalid;
To match getViewAngles.  Also simplify mask check.
2021-06-18 15:51:18 -06:00
brainrom 59d3b25932 Able to get view angles with 3DOF 2021-06-18 15:50:28 -06:00
kokokoshka 7e52ffe956 MinGW support 2021-06-18 15:45:26 -06:00
bjorn 526e06d445 Fix mat4 corruption when using vectors;
We correct m[15] to 1.f too late, by that time the undefined 4th
component of the vec3 could have corrupted the rotation/scale.
2021-06-16 16:55:19 -06:00
bjorn 82b7632cea Require material textures to be 2D; 2021-06-12 14:26:39 -06:00
brainrom 3d1775e468 Lua links properly
mlib required to build Lua, dl lib used to load compiled plugins from shared libraries.
2021-06-10 10:37:30 -06:00
bjorn ca4b7d01bc Allow passing vec2 as scale argument;
Useful for planes.
2021-05-31 15:05:13 -06:00
bjorn 46a5c83a08 rm unused variables; 2021-05-31 15:04:24 -06:00
bjorn 89550e55d6 Fix oculus hand model orientation;
- Previously, animate was converting from oculus basis to lovr basis.
- Not all hand models are animated.
- Instead, apply the compensation in newModel.
- This means that both animated and non-animated models have correct orientation.
- Verified that regular getPose is returning correct rotation as well.
2021-05-31 14:35:53 -06:00
Ilya Chelyadin b6c3a8fa17 All-in-One Lua loader 2021-04-30 18:50:35 -06:00
bjorn 0a9956db60 phonon: Fix crash when setGeometry fails;
The call to `free` above was fixed, but the one in the error case
was not.
2021-04-27 22:15:15 -06:00
mcc 2a30a7f38d Get SteamAudio and OculusAudio working on mac. Also add the Phonon target as a dependency when LOVR_USE_STEAM_AUDIO (all platforms), which has no effect but could be useful later if SteamAudio acquires any build steps while still being a runtime-linked library. 2021-04-27 00:02:44 -06:00
bjorn 09c1fe8117 Improve luax_readmesh error handling; 2021-04-23 12:55:21 -06:00
mcc fc87bffbe0 Fix Android CMake build. 2021-04-20 07:45:39 -06:00
Jakob Bornecrantz 28a0356a9a Add overlay support for OpenXR 2021-04-16 14:20:05 -06:00
Jakob Bornecrantz 70ef04e595 Add overlay parameter to headset init 2021-04-16 14:20:05 -06:00
Jakob Bornecrantz 909b43f34a Order OpenXR extension adding 2021-04-16 14:20:05 -06:00
bjorn e4d06211d3 Update README; 2021-04-16 11:20:36 -06:00
Josip Miskovic 8b5d3af9b8 Allow using alpha with hexcode when setting color
Implements #411 proposal
2021-04-15 10:24:35 -06:00
Jakob Bornecrantz b02c30a0e4 Make bin directory AppImage ready 2021-04-13 11:03:57 -06:00
mcc d558996206 Hold lock when changing geometry (prevents crash, see issue #403) 2021-04-12 13:01:54 -06:00
bjorn fa47ecbdd3 v0.15.0; 2021-04-11 08:57:11 -06:00
bjorn 7b7c3132b8 vrapi: Fix lovr.headset.animate flipping left hand; 2021-04-11 08:15:17 -06:00
bjorn 70bbbc4549 Use pulseaudio on linux; 2021-04-11 07:19:49 -06:00
bjorn 046762c564 WebXR: Fix isDown; Fix hand tracking; 2021-04-10 19:41:37 -06:00
bjorn 171ca01d1f tup: add new .idsig file to apksigner extra_outputs; 2021-04-08 16:33:28 -06:00
bjorn d2a9e230bf Rework Sound:getFrames;
It follows a more predictable argument order.

Fixed crash when reading frames into Blob.
2021-04-05 12:52:16 -06:00
bjorn 1ef99882f7 Fix Mesh vertex map memory leak; 2021-04-05 10:24:43 -06:00
bjorn f565a7b69b rm linking to OpenSLES; 2021-04-03 18:42:34 -06:00