bjorn
6539bc1bd2
Make physics orientation getters more consistent;
2020-05-10 02:08:36 -06:00
Bjorn
62fbf7e0e3
Merge pull request #257 from jmiskovic/physics-vectors
...
Physics API support for vectors
2020-05-10 01:04:23 -07:00
bjorn
1e78ac8669
Add r16, rg16, rgba16 texture formats;
2020-05-10 01:59:58 -06:00
Josip Miskovic
e2d1b33eed
Shapes API accepts both vec3 and number coords
2020-05-10 01:12:45 +03:00
Josip Miskovic
2d6f7802f1
Joints API accepts both vec3 and number coords
2020-05-10 01:12:45 +03:00
Josip Miskovic
f2fcc4e5c4
Collider API accepts both vec3 and number coords
2020-05-10 01:12:45 +03:00
Josip Miskovic
add346519a
Physics API accepts both vec3 and number coords
...
When creating shapes and joints, arguments accept either coordinate
numbers as before, or vec3 objects. For functions that receive more than
one set of coordinates, any combination of coordinates and vectors is
accepted.
2020-05-10 01:12:45 +03:00
bjorn
0be36da334
Add beacon devices;
...
There are 4 new devices: beacon/1 through beacon/4. They represent
tracking reference like StemaVR base stations or Oculus cameras.
There are 4 because that's how many base stations you can have in
a single tracking setup.
Right now only OpenVR exposes poses for them.
2020-05-07 17:11:25 -06:00
Bjorn
195966b964
Merge pull request #251 from jmiskovic/world-vectors
...
Physics world accepts both vec3 and number coords
2020-05-07 09:32:36 -07:00
Josip Miskovic
2463737722
Physics world accepts both vec3 and number coords
...
When creating colliders, setting gravity or casting rays on world,
arguments accept either coordinate numbers as before, or vec3 objects.
For functions that receive more than one set of coordinates, any
combination of coordinates and vectors is accepted.
2020-05-07 19:01:30 +03:00
bjorn
9ba814fe3f
omg;
2020-05-04 17:30:41 -06:00
bjorn
ed4b8d1f3d
rm unneeded internal Source functions;
...
Now that things are in the same file, setters for internal source
fields are unnecessary, making things a bit simpler.
2020-05-03 13:02:19 -06:00
bjorn
c455b0750e
rm unused Source functions from header;
2020-05-03 13:00:02 -06:00
bjorn
d847dd663a
rm unused audio headers;
2020-05-03 12:57:50 -06:00
bjorn
b9a2bddd25
Put all the audio stuff in one file;
...
If there was ever some sort of hypothetical switch to a different
audio library, this would make such a switch easier.
2020-05-03 12:54:35 -06:00
bjorn
b0289de9a6
Error instead of crashing when skin has too many joints;
...
ModelData is still allowed to load skins with more joints, since
the limitation is in the graphics side of things (Model).
Eventually we will use a buffer for joints to alleviate this.
2020-05-02 14:14:29 -06:00
bjorn
c0d73ab541
Add resize event; lovr.resize callback;
2020-05-02 13:09:10 -06:00
bjorn
b035f8e4dc
core/fs: Use DWORD instead of uint32_t in fs_read and fs_write;
...
Fixes a warning.
2020-04-30 16:53:10 -06:00
bjorn
ce2a28360d
Unconditionally cast ref to volatile long on win32;
...
This was originally a C++-only contribution, but clang also warns
about it on windows when compiling as C.
It's nice to have one less thing specific to C++.
2020-04-30 16:49:53 -06:00
bjorn
eea73792a6
Minor formatting;
2020-04-30 14:15:36 -06:00
Josip Miskovic
097d39628a
Initialize inertia information for new colliders
...
Inertia matrix has to be calculated with algorithm specific for each
shape. Without calculated matrix the physics behaves very floaty and
slowed down.
2020-04-29 23:05:11 +03:00
Josip Miskovic
a4b0d004a1
Fix collider setOrientation() and setPose()
...
The conversion from angle,ax,ay,az to quaternion is already done in
physics module.
2020-04-28 20:15:09 +03:00
bjorn
7d316d6218
Add internal filesystem module comment;
2020-04-22 01:47:16 -06:00
pendingchaos
28a2e5fd4c
Fix when depth test is disabled but depth write is enabled
...
GL_DEPTH_TEST controls both whether depth testing and depth writes are
enabled. So if depth testing is disabled and depth writes are enabled,
GL_DEPTH_TEST has to be enabled and the compare mode should be GL_ALWAYS.
2020-04-21 23:39:16 +01:00
mcc
b5e72d8bd9
Restart cookie minor changes for PR review
2020-04-16 10:57:13 -04:00
mcc
c32fbdd8fc
oculus mobile driver now supports restart cookie
2020-04-16 00:33:35 -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
mcc
334077c9f8
Fix crash on lovr.event.quit("restart")
2020-04-15 17:59:25 -04:00
mcc
9f5fd60545
The Quest has thumbsticks, not touchpads. Fix constants.
2020-04-15 16:44:39 -04:00
Colby Klein
34cef2673c
use clamp/max macros
2020-04-12 16:17:01 -07:00
Colby Klein
809d9b7385
ignore haptics for non-hands
...
seems a little strange that vibrating head or something would affect the right controller.
2020-04-12 16:12:06 -07:00
Colby Klein
14e79bf8ef
implement haptics on oculus
2020-04-12 16:02:59 -07:00
Bjorn
89e2e6df8e
Merge pull request #236 from mcclure/no-mat4-project
...
Kill mat4_transform_project
2020-04-05 18:07:56 -06:00
mcc
d8abfcfae3
Remove mat4_transform_project, it not only duplicates mat4_transform, it is buggy
2020-04-05 19:51:37 -04:00
Colby Klein
077d90bc79
update ovr driver to newer frame submission api
...
as mentioned on slack.
there are some situations you can get into (high load in some place or other) where the newer frame submission api will behave much more consistently, and I've noticed no negative effects.
besides, the other one is deprecated as best i can tell.
2020-04-02 22:35:12 -07:00
bjorn
aed0499c5f
Add oculus_touch to action manifest;
2020-04-02 22:47:36 -06:00
bjorn
37d8df4784
Allow initializing empty TextureData with Blob;
2020-03-29 13:47:57 -06:00
bjorn
e553672b5a
Fix sampler uniform error message enum;
...
Surprisingly, this appears to be the only place reading out of enum
arrays like this, so there shouldn't be any other places to fix.
2020-03-14 16:46:35 -07:00
bjorn
6d0369d365
Convert some collider functions to use vectors;
2020-03-07 16:35:32 -08:00
bjorn
a01cc5a376
Fix lovr.graphics.getDefaultFilter;
2020-03-05 19:27:08 -08:00
bjorn
c02839f5c2
Allow anisotropy to be used with any TextureFilter;
...
Instead of anisotropic being its own filter, it is now removed and
anisotropy settings can be used with any of the other filter modes.
2020-03-05 09:46:49 -08:00
bjorn
6f6de92d19
Add preliminary WebXR backend;
2020-03-04 22:47:24 -08:00
bjorn
8dcc97745e
Tup: emscripten support; LuaJIT flag;
2020-03-02 23:06:42 -08:00
bjorn
45648baa1c
Scope a variable better;
2020-03-02 22:23:59 -08:00
bjorn
1d6b7619ea
oculus_mobile: Add handModels to bridge;
2020-03-01 18:08:59 -08:00
bjorn
0d098410b3
Shader:send doesn't error on unknown uniform;
...
Instead it returns a boolean indicating if the send worked.
2020-02-27 20:20:02 -08:00
bjorn
90b605f012
Add restart cookie; lovr.event.restart; arg.restart;
2020-02-26 14:40:40 -08:00
bjorn
69dd0d4674
audio: rm paused and stopped states; rm rewind;
...
- There is now just one "playing" state.
- Instead of rewind, use :seek(0).
Note that now there is no way to resume or rewind all tracked sources.
This can be improved in the future if there's a need for it, probably
using variadic or table-based variants of the audio module functions.
2020-02-26 00:25:49 -08:00
bjorn
fa771b04bd
Fix CMake;
2020-02-23 01:01:34 -08:00
bjorn
ef7ebaef85
core/gpu: vulkan feature detection; rm stats;
2020-02-23 00:47:59 -08:00
bjorn
f8b8d427d7
Opaque Mesh; Opaque OpenGL;
2020-02-23 00:29:21 -08:00
bjorn
aabb8cb830
Opaque Shader;
2020-02-23 00:29:21 -08:00
bjorn
d034e8c01b
Opaque Canvas;
2020-02-23 00:29:21 -08:00
bjorn
52d4f7e520
Opaque Texture;
2020-02-23 00:29:21 -08:00
bjorn
b045d42782
Opaque Buffer;
2020-02-23 00:29:21 -08:00
bjorn
5d8bf1d45a
Fix Source:setLooping assert;
2020-02-22 01:01:17 -08:00
bjorn
2cf6d7b109
Improve lovr.filesystem.load errors;
...
Lua was happily compiling nil chunks and making them return empty
strings, which was not a good error experience in situations where
your file couldn't be loaded properly. Now we return nil plus an
error message, which matches LOVE and other Lua conventions.
2020-02-22 00:30:30 -08:00
bjorn
3d3fb71a98
core/gpu: start shader stuff; coherent buffer mapping;
2020-02-21 18:38:33 -08:00
bjorn
93d556b603
zip: read compressed size from central directory;
...
Some zip writers do not write the compressed size to the local file
headers.
2020-02-21 15:44:48 -08:00
bjorn
b9b8062c18
core/gpu: texture views;
2020-02-21 01:48:58 -08:00
bjorn
f428ceacaf
core/gpu: gl backend compiles;
2020-02-20 15:52:41 -08:00
bjorn
7d2bec7283
core/gpu: add vulkan backend;
2020-02-20 12:23:31 -08:00
bjorn
6452f51680
core/gpu: attribute formats;
2020-02-19 20:28:30 -08:00
bjorn
a658da78ad
core/gpu: Add all uncompressed texture formats;
2020-02-19 19:36:30 -08:00
bjorn
aadadb968b
core/gpu: will it blend;
2020-02-19 18:33:59 -08:00
bjorn
0620cade9e
core/gpu: gpu_set_vertex_buffers; fixes;
2020-02-19 18:02:37 -08:00
bjorn
cb4a7a5a43
core/gpu: indirect drawing commands;
2020-02-19 17:42:33 -08:00
bjorn
238496de29
Start core/gpu;
2020-02-19 17:21:40 -08:00
bjorn
81f4232da5
opengl: Init compareMode for native textures;
2020-02-19 15:34:32 -08:00
Bjorn
98d2cc6cd4
Merge pull request #227 from mcclure/no-post-distortion
...
Instead of showing post-distortion in Oculus mirror, show the left eye (no stereo)
2020-02-17 18:02:47 -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
Bjorn
c17af6c798
Merge pull request #225 from mcclure/msvc-2019-cpp
...
Fix ref.h in recent MSVC when compiled as C++
2020-02-17 17:54:44 -08:00
bjorn
aa0e01ddab
Cleanup;
2020-02-17 17:27:57 -08:00
bjorn
bfdebffb34
Fix volume textures;
2020-02-17 17:27:57 -08:00
Bjorn
74b9258671
Merge pull request #228 from mcclure/skybox-uv
...
Fix lovr.graphics.skybox()
2020-02-17 16:48:32 -08:00
mcc
6536216aa2
Fix lovr.graphics.skybox()
2020-02-17 18:19:05 -05:00
mcc
c22c55865a
Instead of showing post-distortion in Oculus mirror, show the left eye (no stereo)
2020-02-17 17:43:47 -05:00
mcc
7db4e4976b
Fix compile warnings (MSVC2019)
2020-02-17 17:42:13 -05:00
mcc
e7938fe514
Fix ref.h in recent MSVC when compiled as C++
...
A cast is required at this point in MSVC 2019 when ref.h is included from a C++ file. This change has no effect on Lovr compiled normally (which compiles only as C), what this change does is make it possible for forks to extend Lovr with C++ files.
2020-02-17 14:47:08 -05:00
bjorn
18dcb07b98
Convert stuff over to use new enum system;
2020-02-16 18:31:02 -08:00
bjorn
d5487cbd40
Better luax_checkoption error messages;
2020-02-16 18:06:06 -08:00
bjorn
c20a6507d2
Add StringEntry for faster enums;
2020-02-16 17:50:51 -08:00
bjorn
47f4319ba8
core/png; rm stb_image_write;
2020-02-16 04:11:55 -08:00
bjorn
7f205d2fb1
WebGL shader fix;
2020-02-16 01:32:07 -08:00
bjorn
2db1f2b743
Fix erroneous GLES enables;
...
None of these exist in OpenGL ES. These were throwing seemingly
innocuous GL errors, so this is mostly just a matter of correctness.
2020-02-16 01:23:27 -08:00
bjorn
8477638fad
Fix warning;
2020-02-15 23:27:25 -08:00
bjorn
d2f4628791
Add pointer devices;
2020-02-14 19:10:37 -08:00
Bjorn
cce7fa8581
Merge pull request #197 from bjornbytes/hand-devices
...
More Hand Stuff
2020-02-13 16:35:14 -08:00
bjorn
409c2ad0c6
Fix projection matrices;
2020-02-13 16:33:17 -08:00
Bjorn
f048f6d6f0
Merge pull request #218 from bjornbytes/android-bounds-size
...
oculus_mobile: Expose bounds dimensions;
2020-02-13 15:53:25 -08:00
Bjorn
56dad769dd
Merge pull request #217 from bjornbytes/android-button-changed
...
oculus_mobile: Expose button changed states;
2020-02-13 15:53:11 -08:00
Bjorn
4b041820aa
Merge pull request #216 from bjornbytes/android-display-frequency
...
oculus_mobile: lovr.headset.getDisplayFrequency;
2020-02-13 15:52:56 -08:00
bjorn
e218733ee2
Make splay axis 1D;
2020-02-13 15:18:12 -08:00
bjorn
a0c7d0235f
leap: rm curl/splay emulation;
2020-02-13 15:13:08 -08:00
bjorn
5197d30b94
Add getSkeleton;
2020-02-13 15:08:59 -08:00
bjorn
0e4c42c8b0
Add pinch axis;
2020-02-13 15:08:58 -08:00
bjorn
81e3119321
leap: curl/splay emulation; openvr fixes;
2020-02-13 15:08:58 -08:00
bjorn
7e34c7adcc
leap: getPose for finger devices;
2020-02-13 15:08:58 -08:00
bjorn
71e63ddac2
openvr: add curl/splay axes for finger devices;
2020-02-13 15:08:58 -08:00
bjorn
d448bdc95c
Finger devices/axes; OpenVR finger poses;
2020-02-13 15:08:58 -08:00
Nevyn Bengtsson
f2d5824a2b
desktop: fix wasPressed/wasReleased
2020-02-13 18:28:02 +01:00
bjorn
443376efde
ModelData: Use union for transform fields;
...
Nodes can have either a transform matrix, or decomposed transform
properties, but never both. Using a union means we can store both
of those variants in the same piece of memory, using the existing
matrix boolean to figure out which one to use.
This reduces the size of the struct by 48 bytes (152 -> 104), which
ends up speeding up some model operations, I'm guessing due to the
CPU cache.
2020-02-11 16:38:31 -08:00
bjorn
155718d161
shaders: Change abstract parameters to named parameters;
2020-02-11 16:17:54 -08:00
bjorn
7edb562732
Add lovr.headset.getTime;
...
Unlike lovr.timer.getTime, this is the predicted time at which the
current frame will be displayed. It can be used in place of
lovr.timer.getTime for smoother animations. It's unclear if this
could be used for a suitable replacement for dt though.
2020-02-09 11:26:23 -08:00
bjorn
e8fdd5d7f0
Support KTX textures containing ASTC data;
2020-02-08 03:57:59 -08:00
bjorn
2097241596
Improve ASTC loading;
...
Just a little more reliable and easier to read.
2020-02-08 03:57:59 -08:00
bjorn
c1e231e756
oculus_mobile: Expose bounds dimensions;
2020-02-08 03:32:50 -08:00
bjorn
adcbe6d707
oculus_mobile: Expose button changed states;
2020-02-07 23:01:01 -08:00
bjorn
8d22935c60
oculus_mobile: lovr.headset.getDisplayFrequency;
2020-02-07 22:21:32 -08:00
bjorn
02a73f333e
oculus_mobile: respect t.headset.msaa;
2020-02-07 22:09:47 -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
bjorn
723f5684cf
Fix mat4_fov and desktop driver projection;
...
OpenVR may need updating now, but at least we know what the correct
approach is now.
2020-02-06 17:32:44 -08:00
bjorn
4a545e4d04
EGL context creation fixes;
2020-02-04 16:48:03 -08:00
bjorn
67ba5f3a82
Add more graphics stats;
2020-01-31 03:43:52 -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
be4db58fa3
"Fix" compute blocks on GLES;
...
There can only be one compute block.
2020-01-30 19:14:25 -08:00
bjorn
c9c5d43829
Shader:hasBlock; Shader:sendBlock errors on missing block;
2020-01-30 18:26:05 -08:00
bjorn
a1a53b4bed
sampler2DMultiview; textureMultiview;
2020-01-30 17:48:15 -08:00
bjorn
78f272247b
newCanvas creates array textures when multiview;
2020-01-30 17:48:01 -08:00
bjorn
d971749b85
oculus_mobile: Fix vrapi_getView* signatures;
2020-01-30 17:09:06 -08:00
bjorn
f8d3172868
opengl: Prefer state.features.compute to ARB_compute_shader;
2020-01-29 18:22:16 -08:00
bjorn
f89998b21f
Add eye/left and eye/right devices;
...
Currently nobody returns data for them, though headset drivers could
start to provide poses estimated from the head pose and IPD info.
This also makes it easier to integrate eye tracking later.
2020-01-29 17:53:03 -08:00
Bjorn
12d2e32903
Merge pull request #206 from bjornbytes/headset-views
...
Headset views;
2020-01-29 17:24:34 -08:00
bjorn
9ea76fac7b
rm placeholder getFov code;
2020-01-29 17:09:23 -08:00
bjorn
c73fadf5a3
Mark compute shaders as available on ES3.2;
2020-01-29 14:08:09 -08:00
bjorn
3c2154c824
Add unused EGL context creation;
2020-01-28 21:42:44 -08:00
bjorn
c9a06a37cb
Refactor main; Add unused android entrypoint;
2020-01-28 21:38:44 -08:00
bjorn
0aa724116e
Headset views;
...
- lovr.headset.getViewCount
- lovr.headset.getViewPose
- lovr.headset.getViewAngles
2020-01-27 22:11:58 -08:00
bjorn
b19a391c32
desktop: emit focus events;
2020-01-27 21:10:27 -08:00
bjorn
56dc8d0b9e
Handle stereo shaders better;
...
- Creating a shader from a DefaultShader will respect the stereo flags.
- Auto shaders will properly be stereo/nonstereo based on the target Canvas.
2020-01-27 16:33:15 -08:00
bjorn
4379d25e1c
Organization;
2020-01-27 14:02:54 -08:00
Cassie Jones
3e09120173
Compile shaders using source lengths
...
The previous implementation relied on glShaderSource inferring source
lengths when the lengths weren't specified. This relies on the sources
being properly null-terminated, however, which isn't the case due to
file loading changes which now use pointer + length. This could cause
intermittent crashes.
Changing this on the shader side meant adding some extra arguments for
passing around shader source lengths. For most of the other cases, where
we're using string literals as the sources, we can just specify -1 as
the length, since OpenGL will calculate the string length for you any
time the length is negative.
2020-01-27 16:13:21 -05:00
bjorn
7ca23bc58a
lovr.headset.getDisplayFrequency;
2020-01-24 23:06:30 -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
8c429e89ac
Fix -Wshadow;
2020-01-23 11:18:04 -08:00
bjorn
08577ee91b
Fix cast-qual warning;
2020-01-23 11:01:27 -08:00
bjorn
4c1917f6ce
Fix some prototypes;
2020-01-23 10:55:46 -08:00
bjorn
0f338c3ebd
Fix getDirectoryItems on windows;
2020-01-22 16:09:35 -08:00
bjorn
ddcdce25dc
Minor style stuff;
2020-01-22 15:41:48 -08:00
bjorn
96d3288dae
Update header;
2020-01-22 15:38:57 -08:00
bjorn
a5424a1932
Microphone:getData supports sampleCount/destination;
2020-01-22 15:36:41 -08:00
Bjorn
3c65d238bc
Merge pull request #193 from alloverse/allo/mic
...
Sound adjustments: SoundData has-a blob, and mic sample size getter
2020-01-22 14:10:26 -08:00
bjorn
f207c4d9a4
zip: Only call munmap if zip file was actually mapped;
2020-01-20 15:59:53 -08:00
mcc
ea06f8d7dc
Filesystem fixes: Use normalize() in lovrFilesystemMount and dir_resolve; ensure enough room for zero terminator in zip_lookup
2020-01-20 17:12:37 -05:00
Nevyn Bengtsson
e10799b8c8
microphone: less throwy, more MAX()y
2020-01-20 08:52:58 +01:00
Nevyn Bengtsson
a5c59e2d12
Fixes from review
2020-01-20 08:49:11 +01:00
Nevyn Bengtsson
0bdb7c7c80
More has-a-ification of texturedata
...
I forgot to stage this yesterday??
2020-01-20 08:48:59 +01:00
Nevyn Bengtsson
95edb43654
TextureData: holds Blob instead of being Blob, just like SoundData
...
also replaces TextureData:getPointer with TextureData;getBlob
2020-01-19 22:59:44 +01:00
Nevyn Bengtsson
91cc385340
Remove redundant SoundData:getPointer()
2020-01-19 22:43:13 +01:00
Nevyn Bengtsson
9127dd823c
Fix bugs in sounddata-has-blob
2020-01-19 21:22:23 +01:00
Nevyn Bengtsson
7107ecd235
SoundData:getBlob()
2020-01-19 17:50:04 +01:00
Nevyn Bengtsson
790629bc3e
SoundData: has-a blob instead of is-a blob
2020-01-19 17:50:04 +01:00
Nevyn Bengtsson
8515cd98fe
Add destination buffer size to microphone:getData()
...
So that we can use OpenAL's internal ring buffer and only dequeue
exactly the amount we need at the moment.
2020-01-19 17:03:35 +01:00
Bjorn
c5edc6dedb
Merge pull request #190 from bjornbytes/android-canvas
...
Android Canvas
2020-01-17 12:19:49 -08:00
bjorn
b1eeda96cb
Small safety fix;
2020-01-16 09:32:12 -08:00
bjorn
0ecd8f6b49
Fix lovr.filesystem.getExecutablePath on macOS;
2020-01-16 09:21:21 -08:00
Bjorn
3a5c3ca97c
Merge pull request #189 from bjornbytes/channel-mutex
...
Channel ownership stuff
2020-01-15 17:54:00 -08:00
bjorn
2a52796c6f
Commenting;
2020-01-15 17:56:09 -08:00
bjorn
c0d1e28deb
Fix ifdef for glTexStorage;
...
It's always present on GLES.
2020-01-14 19:39:10 -08:00
bjorn
da88766e5a
oculus_mobile: Discard depth/stencil buffers after rendering;
...
This was present in lovr-oculus-mobile.
2020-01-14 18:46:00 -08:00
bjorn
541400e0fe
oculus_mobile: Create framebuffers from bridged swapchain textures;
...
This is a change that shifts the responsibility regarding the creation
of OpenGL framebuffers from vrapi-provided swapchain texture handles.
Previously, the LovrApp component of lovr-oculus-mobile was creating
framebuffers and passing native framebuffer IDs to lovr. With this
change, lovr-oculus-mobile passes vrapi's swapchain textures to lovr
unmodified. This allows lovr to create canvases using its conventional
method and also means that the properties of the canvases are no longer
hardcoded, so things like resolution and multisampling can be
customized.
There were also some issues with multiview canvases in LÖVR due to some
misconceptions about how multisampled multiview rendering works. These
issues have also been fixed in this commit.
2020-01-14 18:26:01 -08:00
bjorn
afa5523773
Curve:render always returns 2 points if it's a line;
2020-01-14 01:08:57 -08:00
bjorn
f728496608
Make math module work better in threads;
...
conf doesn't work in threads. While this seems problematic, it can
kinda be considered the right thing. Right now the math module can't
be required at all in threads which seems bad, so we'll make it work
and just ignore the "globals" flag for now.
2020-01-14 00:39:38 -08:00
bjorn
0841268d45
Fix garbled text when printing out spaces;
...
Apparently requesting/rendering zero vertices was clogging stuff
somewhere. It seems good enough to just explicitly not render
anything if we weren't gonna do it anyway.
2020-01-14 00:37:09 -08:00
bjorn
3b8d485fe9
Mesh:setVertices(Blob);
2020-01-14 00:22:35 -08:00
bjorn
bd6d45cd30
Add comment;
2020-01-13 23:51:59 -08:00
bjorn
056c1e7fe4
Simplify Channel cleanup;
2020-01-13 23:49:52 -08:00
bjorn
46c685bd27
Make channel creation threadsafe;
2020-01-13 23:49:52 -08:00
bjorn
48b887f7ee
Always pass identity matrix for animated shader;
...
So at least something shows up if you have an unskinned mesh with
a skinned shader.
2020-01-13 20:47:47 -08:00
bjorn
3c68e9e97a
Fix some compile warnings/style;
...
Also I am little unsure about the _unused part. It seems like we
were passing it ALuint** when the spec says it takes ALuint*.
2020-01-13 20:45:36 -08:00
bjorn
bb7bcb9b3d
Fix lovr.data.newBlob(blob);
2020-01-13 20:39:43 -08:00
Bjorn
5dd35edcb3
Merge pull request #188 from mcclure/newthread-crash
...
Fix segfault on lovr.thread.newThread(nil)
2020-01-13 19:50:35 -08:00
Bjorn
180a3adb8f
Merge pull request #180 from alloverse/raw-audiostream
...
Real-time raw AudioStreams
2020-01-13 19:49:57 -08:00
mcc
2a3b4694f5
Fix crash on lovr.thread.newThread(nil)
2020-01-11 14:56:26 -05:00
Nevyn Bengtsson
972eb108c0
NULL is not valid for buffers in UnqueueBuffers
2020-01-11 16:31:06 +01:00
bjorn
dc1c011380
Fix bug with std140 offset logic;
2020-01-09 21:57:25 -08:00
Nevyn Bengtsson
3279c0d3f0
Document buffer unqueueing in source play
2020-01-09 16:37:28 +01:00
bjorn
42c85c39fb
rm 1ms sleep from main loop;
...
It's causing massive problems on windows, and sleeping for zero ms
is good enough to relinquish CPU time to the OS. VR APIs also do
their own sleeping.
2020-01-08 23:58:11 -08:00
Nevyn Bengtsson
ab3e7a52fa
AudioStream: fix broken GetDurationInSeconds
...
d'oh
2020-01-09 00:01:18 +01:00
Nevyn Bengtsson
86ba2feeeb
RawAudioStream: Use cursor instead of realloc-remainder
...
Previous code would wastefully reallocate memory for every time a buffer is too big to fit. New code just uses an index into the next buffer at which to start reading, requiring no extra allocation.
2020-01-08 23:52:08 +01:00
Nevyn Bengtsson
1ca57a073c
style fixes after review
2020-01-08 23:44:28 +01:00
Nevyn Bengtsson
edbfbf9bdc
audiostream: make getDuration consistent between raw and buffer-based
...
queueLength was in samples, samples was samples/channelCount. Now samples is always samples, and the division by channels occurrs in the new getter
2020-01-08 17:58:25 +01:00
Nevyn Bengtsson
af6b3515ef
audiostream: use samples
instead of queueLength
...
Instead of having a bogus samples ivar in AudioStream when it's raw, use it to denote the amount of audio data enqueued.
This means `stream:getDuration()` gets the same meaning as `stream:getQueueLength()` (except in seconds instead of samples), so we can remove the latter.
2020-01-08 17:55:04 +01:00
Nevyn Bengtsson
3cb7649996
audiostream: what the heck is memory.h
...
fixes review comment
2020-01-08 17:49:13 +01:00
mcc
dac50c4687
Pragma once in core/hash.h
2020-01-06 13:55:39 -05:00
Nevyn Bengtsson
ae5877a299
Rewind raw sources on explicit stop
...
I missed this one in dbe2edd8
2020-01-05 21:26:41 +01:00
Nevyn Bengtsson
1db932d856
Source: Stop, then unqueue buffers
...
Doing it the other way around is illegal; you may not unqueue unprocessed buffers, so we need to stop first.
2020-01-05 21:26:14 +01:00
Nevyn Bengtsson
b3fb31f5a4
Destructor for raw audio stream
2020-01-05 21:19:08 +01:00
Nevyn Bengtsson
dbe2edd89d
Source: Do rewind on stop like before, and clear buffers
...
I changed my mind. Let's use rewind to clear buffers on a raw stream like Bjorn suggested, and put rewind at stop like it was before.
2020-01-05 21:08:30 +01:00
Nevyn Bengtsson
a8b4dc673d
Accessor for RawAudioStream:getQueueLength
...
Useful for determining current amount of latency.
2020-01-05 00:05:29 +01:00
Nevyn Bengtsson
5232aa2ff2
RawAudioStream: Add a limit to amount of queued data
...
This is useful for making sure the audio subsystem doesn't go haywire with too much generated data
2020-01-04 23:49:58 +01:00
Nevyn Bengtsson
2d681260e5
RawAudioStream: Fix byte/sample confusion
...
dequeue_raw thought that size was in bytes, but it's in samples.
2020-01-04 23:22:58 +01:00
Nevyn Bengtsson
a3720b494b
RawAudioStream: Fix use-after-free
2020-01-04 02:02:32 +01:00
Nevyn Bengtsson
e85a9b74c6
Audio source: unqueue before playing
2020-01-04 01:58:03 +01:00
Nevyn Bengtsson
a274eb05d1
RawAudioStream: Fix a buncha crashes
...
It's still buggy but at least less so
2020-01-03 23:01:21 +01:00
Nevyn Bengtsson
33bee6ce44
Audio: Rewind on play, not stop
...
Before, streams were rewound when they stopped, so that next time they're played they're played from the start.
Instead, rewind on play instead, so that it's done when it's needed. This gets us a good point to make sure we're not rewinding raw streams too.
2020-01-03 23:00:58 +01:00
Nevyn Bengtsson
c6806f50e1
RawAudioStream: getter for isRaw
...
And disallow looping raw streams
2020-01-03 22:59:37 +01:00
Nevyn Bengtsson
4fb4f6cdd1
RawAudioStream lua API
2020-01-03 17:15:12 +01:00
Nevyn Bengtsson
f6abb8d714
Raw audiostream implementation
...
Naive unoptimized implementation to get a feel
for the API design.
2020-01-02 20:34:55 +01:00
Jason Dogariu
163367a3ba
rm pragma pack to fix OpenVR on Linux and Mac
2020-01-01 17:34:45 -05:00
bjorn
c9b1f257bf
api: try new file naming convention; Tupfile: cleanup;
...
I assume full responsibility for any catastrophes this causes.
2019-12-31 19:31:44 -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
12fcaffc3b
Slight update to lovrDirSep;
...
Macro instead of global variable.
2019-12-29 10:30:26 -08:00
bjorn
79fd5ad7d8
Name boot.lua chunk properly;
...
This makes error messages nicer.
2019-12-28 23:18:03 -08:00
bjorn
e538965f77
Add newline to end of stb_image.h;
2019-12-28 23:16:36 -08:00
bjorn
a5db2d6c5c
mv appveyor config to resources folder;
2019-12-28 20:13:19 -08:00
mcc
21a52368f5
Patch in thread local storage for stb_image vflip
...
This makes loading images in multiple threads concurrently safe.
Adds a new CMake variable LOVR_USE_THREADLOCAL, by default on
2019-12-20 16:09:18 -05:00
mcc
735d2e1011
Upgrade stb_image from v2.12 to v2.23
2019-12-20 16:24:05 -05:00
bjorn
a103637419
Fix ModelData refcounting;
2019-12-20 04:52:55 -08:00
bjorn
d1657f401d
Fix some memory leaks;
2019-12-20 04:13:38 -08:00
Bjorn
ebde129204
Merge pull request #174 from mcclure/android-0.14
...
Android fixes. Major change is lovrMain() {} is now lovrMain {}
2019-12-17 17:23:50 -08:00
Bjorn
6c6e5bb60d
Merge pull request #173 from mcclure/file
...
Bring back old File C API (read-only currently)
2019-12-17 17:22:09 -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
mcc
3ff94d8797
Bring back old File C API (read-only currently)
...
This code path is not used anywhere in this commit, but aids in developing Lovr addons.
2019-12-17 20:06:42 -05:00
mcc
ff1ae2c050
Minor fix to let header files compile in C++
2019-12-17 20:02:33 -05:00
bjorn
fd437423e7
Fix refcount alignment;
...
Once and for all? How does alignment even work.
2019-12-15 17:04:26 -08:00
Bjorn
16b93869ee
Merge pull request #143 from bjornbytes/shadow-samplers
...
Shadow samplers;
2019-12-14 11:34:38 -08:00
bjorn
0d156549f7
Fix remaining references to platform;
2019-12-13 19:59:09 -08:00
bjorn
bb279b451c
Fix remaining platform references;
2019-12-13 19:58:22 -08:00
bjorn
e2d8f8c645
platform -> os;
...
The function names are staying the same for now.
2019-12-13 19:55:46 -08:00
bjorn
63dc8f6c9b
Only use glfw for window creation;
...
This allows for headless operation. Currently GLFW throws an error
if you call glfwInit without an X server running, preventing lovr
from starting at all in that situation.
Because GLFW is currently used for time functions, those had to be
moved into the platform layer. There's lots of duplication here,
ideally the platform layer would just return raw timer values and the
timer module would handle the epoch logic, but it was too difficult to
coordinate that right now.
Also, lovrPlatformInit is guaranteed to set the time epoch to 0 now.
2019-12-13 19:55:46 -08:00
bjorn
5957a1d007
Channel:peek also returns status;
2019-12-13 19:53:31 -08:00
bjorn
e2f67c106d
Thread:start supports up to 4 arguments;
...
They are passed to the chunk.
2019-12-13 15:50:10 -08:00
bjorn
33991b41ad
tup macOS fixes;
...
- Need to use dylib suffix.
- Need pagezero stuff (should we only do this when using LuaJIT?)
- rpath is totally different.
- stb_vorbis alloca broke?
2019-12-13 07:27:37 -08: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
5957d07448
Fix warnings;
2019-12-13 03:41:35 -08:00
bjorn
fe422ba60f
Use nanosleep instead of usleep;
...
usleep is deprecated and does not exist on some new Linux systems.
2019-12-13 03:41:02 -08:00
bjorn
1ebe68b934
tup: make CONFIG_ENET=n work;
2019-12-10 15:21:34 -08:00
bjorn
e316e6156b
lovr.graphics.get/setColorMask;
2019-12-10 13:44:51 -08:00
bjorn
c87d6dec3d
lovrPlatformGetProcAddress;
...
Seems nicer than a global and allows for logging/hooks;
2019-12-10 13:15:12 -08:00
bjorn
2f9400a5f7
Adjust includes;
2019-12-10 13:01:28 -08:00
bjorn
b518a4c983
rm misc physfs;
2019-12-10 12:38:06 -08:00
bjorn
403ed8d3b0
Windows;
2019-12-10 12:19:50 -08:00
bjorn
8795ebb31d
Windows WIP;
2019-12-10 12:19:50 -08:00
bjorn
488c125c5f
Draw the rest of the owl;
2019-12-10 12:19:50 -08:00
bjorn
6a8048765f
luax_loadfile uses core/fs;
2019-12-10 12:19:50 -08:00
bjorn
d2b0b30faf
Texture:encode doesn't use File;
2019-12-10 12:19:50 -08:00
bjorn
8da7df68d8
core/fs;
2019-12-10 12:19:50 -08:00
bjorn
f3745a1edc
Use uint64_t for seed in luax_checkrandomseed;
2019-12-05 13:46:12 -08:00
bjorn
bc948e7ea5
rm trailing whitespace;
2019-12-05 13:40:05 -08:00
bjorn
bfd63e3515
Use restrict modifier in curve evaluation;
...
Allows compiler to emit SIMD, way smaller/faster.
2019-12-05 13:39:04 -08:00
bjorn
c07b9e3fec
rm unnecessary include;
2019-11-28 16:04:41 -08:00
bjorn
08f90ab1bd
Make refcount 64 bits to avoid alignment issues;
...
There may be a better way to solve this, but I can't think of one
that doesn't also violate strict aliasing.
2019-11-28 16:03:42 -08:00
bjorn
1030c01a35
Stop aligning pool memory;
...
It isn't necessary anymore since we aren't hiding data in the alignment
bits and it seems to be causing problems in wasm.
2019-11-28 15:59:04 -08:00
bjorn
b9f5ece72b
Fix arr_splice;
2019-11-28 15:58:38 -08:00
bjorn
3e347f0521
Properly initialize uniform.dirty;
2019-11-28 15:31:27 -08:00
bjorn
ad5389b1f4
Improve luax_readquat(nil);
2019-11-28 15:26:52 -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
2a5bae0b18
Improve error messages for unknown types;
2019-11-27 20:45:18 -08:00
bjorn
2ecc1c552f
Fix uniform array hashing;
2019-11-26 11:34:39 -08:00
bjorn
31b5792713
ifdef out glfwInitHint on emscripten;
2019-11-22 19:36:30 -08:00
Bjorn
539e25897b
Merge pull request #157 from bjornbytes/shape-sensor
...
Shape:isSensor; Shape:setSensor;
2019-11-20 18:35:24 -08:00
bjorn
6ad2d8ccef
Add lovrMain macro to shaders (no breaking change);
2019-11-18 23:20:08 -08:00
bjorn
c031c0c578
Fix comment;
2019-11-18 03:37:42 -08:00
bjorn
bd169a4a4d
Fix readable buffers;
...
Unsynchronized/invalidated mapping doesn't work if the read bit is set.
2019-11-14 12:42:52 -08:00
bjorn
9ac34ff190
Add :release to all objects;
2019-11-11 18:42:11 -08:00
bjorn
13136482b9
Fix Channel memory leak;
...
Channels need to be removed from the global array/map when destroyed.
Note that this exposes an infinite loop in map_remove, which will
be fixed later.
Note also that Channel's are retained if they have any messages in
them, to prevent releasing a channel while it has pending messages.
2019-11-11 18:33:33 -08:00
bjorn
8d12f0b867
Make userdata hashes 64 bit;
2019-11-11 16:39:02 -08:00
bjorn
a7e24ab28e
Joint:isEnabled; Joint:setEnabled;
2019-11-11 16:39:02 -08:00
bjorn
0bd5fced12
Use new glfw method for avoiding chdir;
2019-11-03 15:31:21 -08:00
bjorn
d21911d010
Add core/map hash table; rm lib/map;
2019-10-30 00:07:05 -07:00
bjorn
b35ebc15b6
rm LOVR_USE_SSE;
...
It doesn't really improve performance on an average LÖVR app and
isn't worth the complexity.
2019-10-22 16:46:54 -07:00
bjorn
d51d2b4105
Fix stack balance with luax_checkvariant;
...
Was breaking Channel:push.
2019-10-22 16:42:10 -07:00
bjorn
b940f2d53f
Add AABB to OBJ models;
2019-10-21 17:46:28 -07:00
Bjorn
d7b3e1cf46
Merge pull request #160 from nevyn/fix/objc_msgsend_cast
...
Cast objc_msgSend before calling it
2019-10-15 13:12:19 -07:00
Bjorn
0bb3271bb5
Merge pull request #159 from nevyn/fake-controller-position
...
Desktop driver: Move left controller with mouse
2019-10-15 13:05:36 -07:00
Nevyn Bengtsson
ab6e4891e1
Cast objc_msgSend before calling it
...
Calling objc_msgSend with its vararg signature will only work most
of the time, and fail very weirdly when it doesn't. It's weird,
but you're supposed to always cast it to the signature of the
selector you're calling.
I think this is even required when building on Catalina, or for arm64?
2019-10-15 22:00:15 +02:00
Nevyn Bengtsson
e35a5435ca
update leftHandTransform in desktop_update
...
to be consistent with how headTransform is calculated.
also, rename ‘transform’ to ‘headTransform’ for consistency.
2019-10-15 21:50:28 +02:00
bjorn
4d2aa81647
Reset active texture in lovrGpuInit;
2019-10-15 11:34:49 -07:00
bjorn
e32c3ea2df
v0.13.0;
2019-10-14 18:21:07 -07:00
bjorn
d93e17e800
Texture:setCompareMode; Shadow samplers;
2019-10-14 17:12:34 -07:00
bjorn
25fa80f1d5
Fix comment;
2019-10-14 16:10:34 -07:00
bjorn
c3f91e9ff3
Actually fix/test the issue with .lovr files on macOS apps;
2019-10-14 15:24:02 -07:00
bjorn
f6cd8120ad
Add macOS bundle resources;
2019-10-14 15:23:46 -07:00
Nevyn Bengtsson
cb75b387e5
Desktop driver: Move left controller with mouse
2019-10-14 10:08:12 +02:00
bjorn
77258ec4dd
mat4 multiplication works with vec4;
2019-10-13 16:02:21 -07:00
bjorn
ac441ec15b
lovrGraphicsGetCamera;
2019-10-12 12:45:11 -07:00
bjorn
f0342341af
Fix quat:mul accidentally working on vec2/vec4;
2019-10-12 12:43:49 -07:00
bjorn
b6093eda2a
Shape:isSensor; Shape:setSensor;
2019-10-10 15:36:28 -07:00
bjorn
8c0ae3fbb3
More WebVR (controller) fixes;
2019-10-09 14:54:07 -07:00
bjorn
ac53f5a56f
Fix Collider:addShape and Collider:removeShape;
2019-10-08 15:45:53 -07:00
bjorn
6ef27ec7cc
Merge branch 'master' of github.com:bjornbytes/lovr
2019-10-08 15:29:04 -07:00
programmer2
ba0aa13835
Fix World:Collide to use new luax_checkshape
...
This appears to have been missed in commit 22fe333
2019-10-08 21:30:03 +02:00
bjorn
5f404e2b1f
WebVR fixes;
...
- Re-add the maf.c file that exports all the maf symbols.
- Fix lovrGpuTock for WebGL.
2019-10-07 19:50:17 -07:00
bjorn
0c642a6790
Improve mat4:unpack;
...
- Orientation is correct when the matrix is scaled
- Orientation calculation is more efficient
2019-10-04 19:26:09 -07:00
bjorn
eb83962fc6
OpenXR fixes;
2019-10-02 16:29:09 -07:00
bjorn
17dda66b69
boot.lua works without headset module;
2019-10-02 16:20:50 -07:00
bjorn
cc858e062c
Don't mind me;
2019-09-26 21:58:26 -07:00
Bjorn
c210d4e11d
Merge pull request #152 from bjornbytes/mac-bundle
...
Load .lovr files from the macOS app bundle;
2019-09-26 20:21:50 -07:00
bjorn
2e44926767
Cleanup;
2019-09-26 20:19:50 -07:00
bjorn
f4c6e9bd12
oculus_mobile: set error callback based on current coroutine;
...
Currently:
- load/update/run/etc. take place on the boot.lua coroutine.
- draw happens "asynchronously" on the main thread.
When C needs to throw an error, it doesn't know which thread to
throw the error on. If it throws it on the wrong thread, you get
a crash instead of an error screen.
One way to fix this is to change the error context based on the
thread that's currently running, so that errors in C are thrown
on the correct thread. This is the approach that's taken here.
A potentially better approach would be to run all the code on the
same thread, but I ran into issues when I tried to do this.
It may also be possible to (ab)use the Lua panic handler to catch
errors on one of the threads and somehow forward them to the other.
2019-09-26 18:46:19 -07:00
Bjorn
d23f2f5810
Merge pull request #151 from sophiabaldonado/oculus-mobile-fix-error-screen
...
Throw lua errors in the error handler
2019-09-26 18:44:05 -07:00
mcc
dc92eb5c58
Oculus mobile vibrate() returns false on illicit second call; style changes
2019-09-26 19:32:12 -04:00
mcc
4a41f98562
Vibrate function for Oculus Quest, first pass
...
Only does "simple" vibrate (hard on/off). Supports duration but not frequency. Requires a corresponding commit in the lovr-oculus-mobile repo.
2019-09-26 18:40:04 -04:00
bjorn
0129a80b27
Load .lovr files from the macOS app bundle;
2019-09-24 21:37:44 -07:00
sophia
ef84a16716
Throw lua errors in the error handler;
2019-09-24 12:04:36 -07:00
bjorn
403b217781
Fix Model destructor memory issues;
...
- Memory leaks.
- Freeing things that weren't allocated.
2019-09-20 13:46:27 -07:00
bjorn
2c29119e44
Fix non-interpolated cubic spline keyframe evaluation;
2019-09-19 23:01:50 -07:00
bjorn
22beccedc3
Model:getAnimationDuration;
2019-09-19 19:21:31 -07:00
bjorn
1902787b1b
Modify GPU timer API;
...
- lovr.graphics.tock returns the latest value of the timer, or 0.
- Timers are not in the stats table anymore.
This is to prepare for an upcoming internal change that affects timers.
2019-09-18 18:21:38 -07:00
bjorn
e96c541244
Multithreaded builds on Windows; Formatting;
2019-09-18 16:12:08 -07:00
bjorn
f82bcb703b
Finalize skeletal input API;
2019-09-18 16:12:08 -07:00
bjorn
6c130ebd86
Fix warning;
2019-09-18 16:12:08 -07:00
bjorn
b3f1b1db0c
mat4:rotate uses y axis by default;
2019-09-13 23:22:29 -07:00
Bjorn
e4d54f8aa6
Merge pull request #148 from mcclure/signed-lovrViewID
...
Make lovrViewID signed on Oculus Mobile (fix "mask" example)
2019-09-12 00:01:28 -07:00
mcc
785c7c722b
Oculus mobile: Promote Lua print() statements to INFO
...
This means Lua print() statements can be uniquely filtered out vs anything else (because internal Lovr logging uses loglevel DEBUG and lovr errors use loglevel WARN).
2019-09-11 19:43:44 -04: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
mcc
c9cc5362bd
model:getAnimationName(idx) and model:getNodeName(idx)
2019-09-04 21:09:54 -04:00
mcc
8b18c735ca
model:getMaterialName(idx)
2019-09-04 17:17:56 -04:00
bjorn
5ed132635a
Fix error screen when headset module is disabled;
2019-09-03 15:34:41 -07:00
bjorn
3e47f958ad
Fix mat4:lookAt;
2019-08-31 05:45:19 -07:00
bjorn
39376a10d5
normalTexture -> normalMap;
2019-08-31 05:31:20 -07:00
bjorn
79b5d2962c
Fix problem with vector lightuserdata handles;
2019-08-31 03:08:42 -07:00
bjorn
9ea785d210
Fix normal matrix;
...
Now that lighting is in world space.
2019-08-31 03:00:54 -07:00
bjorn
17ae64baec
Fix sphere winding;
2019-08-31 03:00:40 -07:00
bjorn
00412e2e79
Add a conf.lua flag for making the window resizable;
2019-08-28 00:59:03 -07:00
bjorn
50a1629dbc
Model:get[Animation|Material|Node]Count;
2019-08-27 15:02:24 -07:00
bjorn
31fed6a940
Fix stereo flag for custom shaders;
2019-08-27 14:59:17 -07:00
bjorn
f97031a8ec
Fix Android print with multiple arguments;
2019-08-26 16:19:58 -07:00
bjorn
305596adf8
Fix windows build;
...
LOVR_EXPORT needs to be on the declaration, unfortunately.
2019-08-26 15:53:10 -07:00
bjorn
f64e2064ef
Adjust Canvas padding so it's 128 bytes;
2019-08-23 01:43:35 -07:00
bjorn
80eaea21f1
Adjust Buffer padding so it's 48 bytes;
2019-08-23 01:35:46 -07:00
bjorn
8d8f4eef73
Adjust Texture padding so it's 64 bytes;
2019-08-23 01:34:23 -07:00
bjorn
a073206c20
Standard shader: Fix some precision issues in GLES;
2019-08-22 21:57:59 -07:00
bjorn
e9654cd067
Fix function prototypes;
2019-08-21 23:19:42 -07:00
bjorn
28344928c9
Simplify arr;
2019-08-21 23:16:58 -07:00
bjorn
9b0e43b249
Fix t.window = nil;
2019-08-21 22:26:31 -07:00
bjorn
13655d0df4
Simplify logging;
2019-08-21 19:02:02 -07:00
bjorn
cd09e1e695
rm sds;
2019-08-21 16:30:20 -07:00
bjorn
8d4760167f
luax is now api;
2019-08-21 15:27:26 -07:00
bjorn
7c8a44cc57
Cleanup function pointer typedefs;
2019-08-21 14:44:54 -07:00
bjorn
fb279057b8
maf no longer needs to export symbols;
2019-08-21 03:29:37 -07:00
bjorn
b51dece762
Fix bug with permanent vectors;
2019-08-20 00:54:42 -07:00
bjorn
f91eed3834
Rebuild boot.lua.h;
2019-08-20 00:54:36 -07:00
bjorn
3050d70f3d
Slightly better OpenVR head pose;
2019-08-19 14:55:28 -07:00
bjorn
e6c9fd1a6e
rm error screen buttons;
2019-08-19 14:52:56 -07:00
bjorn
26e7233fde
Fix some API issues with lightuserdata;
2019-08-19 14:35:06 -07:00
bjorn
b1b97ddb02
quat:direction returns vec3;
2019-08-19 14:19:10 -07:00
bjorn
97e90a8699
Fix checkvariant error message;
2019-08-19 14:16:42 -07:00
bjorn
2f7743583f
Rebuild actions.json.h;
2019-08-19 14:16:37 -07:00
bjorn
584261e21f
rm ffi vectors;
2019-08-19 14:13:36 -07:00
bjorn
e6bedba0bc
Fix OpenVR head pose;
2019-08-17 22:50:35 -07:00
bjorn
c703092f87
Add missing timers GraphicsFeature;
2019-08-13 22:11:59 -07:00
bjorn
a4781c7013
Fix cylinder winding;
2019-08-12 20:03:32 -07:00
bjorn
d3bf51daef
Add alphaCutoff shader flag;
2019-08-12 17:38:03 -07:00
bjorn
c3af8c14c1
Add uniformScale shader flag;
...
Used to switch to a faster version of lovrNormalMatrix, can be used
with all shader types.
2019-08-12 17:33:32 -07:00
bjorn
8821ecd340
Standard shader: Tonemap by default;
2019-08-12 02:36:23 -07:00
bjorn
4eb768b13b
Fix GLSL type cast;
2019-08-11 18:47:12 -07:00
bjorn
265931e474
Standard shader: Multiply with graphics color;
...
I guess.
2019-08-11 18:34:16 -07:00
bjorn
51b4064801
Standard shader: Refactoring;
2019-08-11 18:15:43 -07:00
bjorn
3d8313a7f1
Add analytical approximation for specular BRDF lookup;
2019-08-11 17:22:09 -07:00
bjorn
4719e5edbe
Well that was broken;
2019-08-10 18:12:16 -07:00
bjorn
93f076acc9
Fix default uniform values;
...
Not supported in GLES.
2019-08-09 17:36:14 -07:00
bjorn
b8cb53e021
Standard shader: Refactoring;
2019-08-09 17:31:30 -07:00
bjorn
948363e7df
OpenGL: Enable seamless cubemap filtering;
...
It is always used in WebGL 2 and OpenGL ES 3.
2019-08-09 17:22:00 -07:00
bjorn
4d3bfea67c
Model:getMaterial(name|index); rm Model:setMaterial;
2019-08-09 16:10:46 -07:00
bjorn
bd773d2d6c
Add materialMap to ModelData;
2019-08-09 15:14:22 -07:00
bjorn
83b2f8d745
Add uniform for controlling light color and intensity;
2019-08-09 00:27:17 -07:00
bjorn
a1cc3fb838
rm lovr.headset.getDisplayTime;
...
It is not useful in its current state, but will be useful later.
2019-08-09 00:01:08 -07:00
bjorn
851f5f27ec
Add more default headset drivers;
2019-08-09 00:00:42 -07:00
bjorn
30ea8995d2
Fix view vector;
2019-08-07 17:53:38 -07:00
bjorn
2c115ce66e
Automatically detect mipmap count for IBL;
2019-08-07 15:56:52 -07:00
bjorn
b5be93b94b
Fix problem with falsy shader flags;
2019-08-07 15:56:13 -07:00
bjorn
289d365866
Better error messages when loading cubemaps;
2019-08-07 15:14:59 -07:00
bjorn
fe939213be
Initial standard shader flags;
...
- normalTexture = true
- indirectLighting = true (requires uniform setup!)
- occlusion = true (only affects indirect lighting)
- emissive = true
- tonemap = true
2019-08-06 14:39:14 -07:00
bjorn
54d58c79cd
Fix issue where multiple shader flags don't work;
2019-08-06 14:38:49 -07:00
bjorn
edd162052c
Fix diffuse texture batching;
2019-08-06 11:38:12 -07:00
bjorn
b08d9d0b30
Standard shader: Add tonemapping;
...
ACES.
2019-08-05 15:34:21 -07:00
bjorn
96c47d590c
rm lovrEnvironmentTexture from Material;
2019-08-05 15:20:17 -07:00
bjorn
e4ab5aa85a
Standard shader: Add image-based lighting;
...
Very WIP, still need to add the BRDF lookup table.
2019-08-05 14:49:09 -07:00
bjorn
bff9399308
Rename skinned flag to animated;
2019-08-04 15:08:21 -07:00
bjorn
017dd15c78
Update OpenXR to 1.0;
...
Still untested, gib runtimes pls.
2019-08-03 19:06:57 -07:00
bjorn
06fb8b2503
Simplify fill;
...
lovr.graphics.fill renders a fullscreen quad, it's convenient because
you don't need to set up a mesh and toggle all the pipeline states.
However, if you are dealing with copying/rendering between stereo
textures, you have to write your own shader for that. For now.
2019-08-03 16:03:13 -07:00
bjorn
db57592646
Attempt to display SOME relevant message for 'error occurred while displaying another error' in the luajit-only nonstandard crash path
2019-08-02 20:29:28 -07:00
bjorn
e9fd052fc6
Start fixing lovr.graphics.fill;
2019-08-02 15:48:35 -07:00
bjorn
0d5c776b02
Windows opens console with --console argument;
...
Instead of all the time.
2019-08-01 13:49:39 -07:00
bjorn
aab987dbef
Fix WebGL gamma correction;
...
Ugh, WebGL doesn't have sRGB backbuffers.
2019-08-01 13:26:45 -07:00
bjorn
d03d0a39ec
Fix GCC compilation;
2019-08-01 13:02:31 -07:00
bjorn
15cdc78c6b
Rebuild xxd files;
...
xxd on windows is different or something.
2019-08-01 13:01:47 -07:00
bjorn
38671d4ca9
Fix warning;
2019-08-01 13:01:41 -07:00
bjorn
ecac39c08b
Add experimental buttons to default error screen;
2019-08-01 00:14:37 -07:00
bjorn
7690db28af
Windows: Fix all the int warnings;
2019-07-31 17:51:49 -07:00
bjorn
c384d54aa5
OpenVR: Default haptic frequency to 1Hz;
2019-07-31 17:17:41 -07:00
bjorn
9e8fcc01af
Knuckles: Use force sensor as grip axis;
2019-07-31 16:54:56 -07:00
bjorn
ca8e280dcd
Fix texture refcounting in lovr.graphics.newTexture;
...
Also a memory leak with window icons (does anyone use that?)
2019-07-31 14:43:35 -07:00
bjorn
507736ba2d
Oh no;
2019-07-31 14:43:31 -07:00
bjorn
78f2060405
rm lovr.headset.getAcceleration, getAngularAcceleration;
...
Because OpenXR did...
2019-07-30 20:22:08 -07:00
bjorn
9712f4765c
lovr.headset.hands is CURSED;
2019-07-30 20:17:38 -07:00
bjorn
947c468eb1
Don't restart twice on F5;
2019-07-29 11:52:06 -07:00
bjorn
4b9e6849c8
Better boolean shader flags; Multicanvas flag;
...
Instead of boolean shader flags turning into actual booleans defines
in the shader source, for GLSL they turn into defines. This lets you
use ifdef, which is the more common intended usage.
Also MULTICANVAS is now a boolean shader flag. The old MULTICANVAS
define is deprecated.
2019-07-28 18:08:23 -07:00
bjorn
f564444641
Fix some WebGL issues;
2019-07-28 17:28:18 -07:00
mcc
d391a4750f
Use base diffuse color from materials in Standard shader
2019-07-25 15:08:53 -07:00
bjorn
239a9514ea
Model: Fix animations that aren't keyed at t=0;
2019-07-19 16:42:51 -07:00
bjorn
d0ee0d9b1a
glTF: Fix transform for scenes with multiple root nodes;
2019-07-19 16:42:13 -07:00
bjorn
2b19c64aca
rm primary DeviceButton and DeviceAxis;
...
It is confusing and doesn't really solve the intended problem very well.
For now we will all just suffer with our tedious device-specific Lua code.
2019-07-17 17:33:21 -07:00
bjorn
c92c0ef3c5
lovr.headset.isTracked;
2019-07-17 17:09:45 -07:00
bjorn
416f28990a
Tracking functions return 0 instead of nil; rm lovr.headset.getDirection;
2019-07-17 17:07:33 -07:00
bjorn
62fe520da1
maf: Fix quat_getDirection;
2019-07-16 23:03:37 -07:00
bjorn
a04d55d13e
Fix quat indexing in vanilla Lua;
2019-07-16 23:03:27 -07:00
bjorn
013d301c35
Fix vec3:sub in vanilla lua;
2019-07-16 22:53:01 -07:00
bjorn
a5326d530a
LuaJIT: Fix quaternion __newindex;
2019-07-16 22:52:34 -07:00
bjorn
7f445db3cc
Update mat4:set for vanilla lua;
2019-07-16 22:51:26 -07:00
bjorn
db519f7f53
mat4:scale: Allow for a single argument in LuaJIT;
2019-07-16 22:02:18 -07:00
bjorn
122143b13a
vec4;
2019-07-16 20:30:51 -07:00
bjorn
9156fa2cbf
Vector rework;
2019-07-16 20:30:51 -07:00
mcc
39f8203442
Don't reset camera position of desktop driver on reset
2019-07-16 20:27:45 -07:00
bjorn
84cdc592bc
Make sure lovrBufferUnmap always unmaps;
2019-07-12 20:16:18 -07:00
bjorn
2eb4b779ab
Model cleanup;
2019-07-11 20:13:47 -07:00
bjorn
4b4020d3a7
Model:pose; Model:getNodePose;
2019-07-11 20:09:46 -07:00
bjorn
8e2775ef6d
Math: cleanup;
2019-07-11 11:35:50 -07:00
bjorn
6b87576e6d
Channel: cleanup;
2019-07-11 11:29:18 -07:00
bjorn
8c76e6f19b
RandomGenerator: cleanup;
2019-07-11 11:24:34 -07:00
bjorn
1f8a7e073f
Curve: cleanup;
2019-07-11 11:22:03 -07:00
bjorn
f81a65430b
Add support for cubic spline keyframe interpolation;
2019-07-11 11:05:53 -07:00
bjorn
3c07ad6b0b
Replace Animator with Model:animate;
2019-07-10 22:08:19 -07:00
bjorn
4372eb293e
rm comma operator;
...
everyone is making fun of me haha
2019-07-10 18:46:51 -07:00
mcc
f5633f4248
Fix lovr.filesystem.append()
...
Previously, this program function lovr.update(dt) lovr.filesystem.append("/test123", lovr.timer.getTime()) end would fail in lovr because lovrFileWrite required the file to be in write mode (not append)
2019-07-10 16:29:09 -07:00
mcc
a6936b5649
Fix -DLOVR_ENABLE_THREAD=OFF compile
...
l_event.c was processing a thread-related event and in the process using a thread struct, even when LOVR_ENABLE_THREAD is undefined and threads do not exist. I caused the thread event type to simply not exist when the thread module is not being built.
Since the event is now only sometimes present, I put it at the end of the enum as slight protection against binary mismatches with dynamically loaded modules.
2019-07-10 16:23:20 -07:00
mcc
070892ee12
Fix crash with lovr.event.quit("restart") on Oculus Mobile
...
Because of how and when draws occur in our Oculus Mobile path, during a restart it would attempt to draw a frame after lovrGraphicsDestroy() is called, leading to a crash in lovrGraphicsSetCamera(). This blocks draws until the restart is finished and renderTo() has been called (conveniently detectable using the existing state.renderCallback).
2019-07-10 16:10:02 -07:00
mcc
8bfc8683db
Patch maf.h so it can be included in C++
...
A C-only feature is used in one spot currently, which would be fine if maf.h were maf.c, but it's designed to be #included...
2019-07-10 14:58:55 -07:00
mcc
38886f0dc4
Patch sds.h so that it can be #included from C++
...
Empty arrays aren't allowed in C++, so a single dummy element has to be added. sds works by scary cast magic so this dummy element is never actually allocated. A #define is used in this patch so in C this compiles exactly the same as before.
2019-07-10 14:58:55 -07:00
mcc
99f8122f23
ref.h compiles in C++
...
Check for GCC version >=4.7 [covers GCC or, theoretically, Intel C Compiler] or __has_builtin(__atomic_add_fetch) [covers Clang]. If either of these are found, prefer the GCC atomic builtins instead of the C11 builtins.
Also: Gates Microsoft atomics on _MSC_VER, not _WIN32. This may help improve compatibility with mingw but has not been tested.
2019-07-10 14:58:25 -07:00
bjorn
f208a5e067
Fix array initialization;
...
Because the new arr.h contains an array on the stack, we can't
initialize it and then copy it, or the pointer to the stack array
will be pointing to the wrong thing, causing incorrect behavior.
2019-07-09 09:06:11 -07:00
bjorn
af29e29e4d
Fix lovr.graphics.setProjection;
...
Needed to be using new frameData stuff.
2019-07-08 14:35:54 -07:00
bjorn
f2feda9420
oculus: Remove offset;
...
Since we are calling SetTrackingOriginType with floor level, we don't
need to apply the seated-level t.headset.offset adjustment.
2019-07-05 01:05:02 -07:00
bjorn
348798b86c
Make shader in nogame screen more correct;
2019-07-02 20:12:24 -07:00
mcc
dc98846169
Fix error screen on Android
...
As discussed in slack, lovr.errhand appears to predate lovr.graphics.hasWindow() and does not use it. This resulted in a crash on Oculus Go
2019-07-02 18:45:08 -07:00
mcc
53270fbd76
mat4_transform_project in maf.h
...
mat4_transform ignores the final row of the matrix, which normally contains scale data. This is fine for modelview matrices, which is all lovr currently uses mat4_transform for. However it fails if you ever use mat4_transform on a projection matrix.
mat4_transform_project takes the final row into account, so you can use it with projection matrices. This was useful in my fork and might be useful to have around in lovr someday later.
2019-07-02 13:37:33 -07:00
mcc
1b085a00ea
As discussed in slack, Oculus should be letting lovrCanvasCreate decide whether to double
2019-07-02 13:28:36 -07:00
bjorn
57f97056da
Use I4ui instead of I1ui for lovrDrawID constant value;
...
glVertexAttribI1ui isn't supported on GLES for some reason.
2019-07-02 12:51:36 -07:00
bjorn
2d6aa18069
Be a little more correct about when draw id is written;
2019-07-02 00:14:01 -07:00
bjorn
775cf5cda1
Don't accidentally draw meshes too many times;
...
Oops!
2019-07-02 00:09:43 -07:00
bjorn
44da36b610
Write draw ids at the right time (fix flicker);
2019-07-01 02:47:59 -07:00
bjorn
2fb393306c
rm skybox args;
...
They used to always be necessary, now they are almost never necessary.
2019-06-29 21:01:03 -07:00
bjorn
e3e930d6cc
Set index buffer at the right time;
...
Just a small ordering issue with previous commit.
2019-06-29 20:39:01 -07:00
bjorn
6256acfc6d
Ahhh fix everything;
...
- If you have an instanced batch, it will use the instanced mesh. That
has a drawID attribute that uses the identity buffer, which has a vertex
divisor. BUT if you only have one instance, then we won't emit an
instanced draw, and the use of a divisor'd attribute w/ a non-instanced
draw is causing mega problems on macOS.
- This also fixes observed macOS bugs like:
- Needing to have a small UBO
- Flickering at startup
- Flicker when writing to the last byte of a UBO
- etc.
- Also make the generic attribute value for lovrDrawID more correct (scalar instead of vector).
2019-06-29 20:24:36 -07:00
bjorn
afe4d8c0e3
Fix GL error with buffer unmapping;
...
This doesn't seem to fix any of the macOS rendering bugs though...
2019-06-29 20:08:31 -07:00
bjorn
d3f08fd1f0
rm logo.png;
2019-06-29 18:28:20 -07:00
bjorn
b2df3e9816
Update nogame screen;
...
- Slightly dim background color (may change).
- Use a shader for the logo (it's centered now, not quite 100% like the image).
- Adjust text optical weight (I hate it).
2019-06-29 18:27:55 -07:00
bjorn
e82ba030a6
lovr.headset.getDisplayTime;
...
Returns the predicted display time, which is the estimated time at which
the photons of the next frame will hit the eyeballs of a person in the HMD.
This should be used instead of lovr.timer.getTime when used for rendering
something that is time-dependent. Updating simulations, logic, or access
to high frequency times should still use lovr.timer.getTime.
2019-06-29 17:36:36 -07:00
bjorn
8faff22f38
Regenerate math.lua.h;
2019-06-28 22:07:31 -07:00
mcc
c604149428
Y-flip mirror texture on Oculus
...
Oculus gives us the mirror texture "upside down" compared to every other driver, so flip it rightside up before drawing in boot.lua.
2019-06-28 22:46:23 -04:00
bjorn
d87fc56b63
lovr.headset.getDisplayMask;
2019-06-28 00:13:45 -07:00
bjorn
4222be88b5
Use UBO for Camera matrices;
...
Ugh I don't like the "Camera" concept anymore, but I can't figure
out how to easily get rid of it. Maybe wait till displays are a thing.
2019-06-27 22:17:50 -07:00
bjorn
fa6c4a6b39
Organization;
2019-06-27 21:04:15 -07:00
bjorn
370124c88d
Batching cleanup;
...
- Rename drawMode to topology in some places.
- Batch uses DrawCommand internally to simplify stuff.
- Do less work while flushing.
- Store global head/tail cursors instead of unused per-batch cursors.
2019-06-27 20:58:42 -07:00
bjorn
779949964f
More small batching changes;
...
- Reduce number of batches to 4. Yeah it's arbitrary, will monitor.
- Just use memcmp for BatchParams. Since we're using designated initializers,
we aren't running into issues with memcmp+struct padding bits, and in the
event it does lead to false positives on some platforms, at worst we'll just
experience a harmless reduction in batching efficiency.
2019-06-27 19:05:54 -07:00
bjorn
6da17b0a91
Optimize gamma correction;
...
Currently, we gamma correct colors on every clear and every draw.
It's taking a lot of time. Instead, we'll gamma correct colors
when they're changed using lovr.graphics.setColor/setBackgroundColor.
2019-06-27 15:41:57 -07:00
bjorn
7e067da8e7
Add defaultCanvas;
...
Having a normal Canvas object that represents the backbuffer reduces
some indirection where we have to last-minute check if a Canvas is
set. It also means that all of the draw-related info that was _sometimes_
on the Canvas is now _always_ on the Canvas, which reduces the amount
of redundant information we need to provide for a draw call.
There may be some issues related to changing the width/height/stereo
of the default Canvas.
2019-06-27 15:36:51 -07:00
bjorn
26e474bcfc
Simplify Mesh handling;
...
Removes some indirection from flush (I guess moves it into batch,
not sure what's better).
2019-06-27 14:14:31 -07:00
bjorn
551dea8c86
Adjust includes;
2019-06-27 13:44:09 -07:00
bjorn
b8e63adcbf
graphics: Cleanup;
...
Make batching structs and defines private.
2019-06-27 13:38:38 -07:00
bjorn
fe21de403b
lovrGraphicsDrawMesh;
2019-06-27 13:35:43 -07:00
bjorn
b3080ae5d9
rm macos instancing hack;
...
I haven't been able to see adverse affects from it anymore. Can
always put it back if it resurfaces.
2019-06-27 13:27:43 -07:00
bjorn
39b0d2d754
graphics: Minor refactoring;
2019-06-27 13:26:39 -07:00
bjorn
297208c205
Minor cleanup to stream buffer code;
2019-06-27 13:01:04 -07:00
bjorn
052990aa47
Make some graphics structs private;
2019-06-27 01:48:35 -07:00
bjorn
2baa8d03ee
Make singlepass detection more readable;
2019-06-26 21:47:22 -07:00
bjorn
adf5e69ea1
oculus: Remove unused variable;
2019-06-26 14:51:32 -07:00
mcc
fc90a03584
Fix MSVC-specific warnings
2019-06-25 19:16:48 -07:00
mcc
430fbc27d5
ovrHand -> ovrHandType in oculus.c. We don't understand how this worked before but it fixes the oculus-windows build.
2019-06-25 19:16:48 -07:00
bjorn
6b2de4a0a1
Temporary implementation for persistent buffer discard;
...
Should fix potential crashes with persistent buffers.
2019-06-25 19:16:08 -07:00
bjorn
010bbff519
openvr: Fix stereo Canvas dimensions mismatch;
...
(The width is automatically doubled when stereo now)
2019-06-25 19:15:38 -07:00
bjorn
312a7617c3
Fix typo in shader;
2019-06-25 19:15:11 -07:00
bjorn
09b6f74acf
Native textures: initialize mipmapCount;
2019-06-25 18:59:31 -07:00
bjorn
749774e2fc
Native texture depth must be explicitly specified;
...
To fix validation errors when attaching them to Canvases.
2019-06-25 18:57:18 -07:00
bjorn
7e65116add
Fix oculus backend;
2019-06-25 18:16:54 -07:00
bjorn
a3d5371d01
rm lib/vec/vec from oculus.c;
2019-06-25 18:07:56 -07:00
bjorn
928ccee5f1
Multiview;
2019-06-25 01:21:59 -07:00
bjorn
a691192af9
lovrBufferDiscard;
2019-06-25 01:21:59 -07:00
bjorn
5cd93b66c6
rm fence syncs;
...
They are too buggy and are not as efficient as orphaning.
2019-06-24 19:17:55 -07:00
bjorn
b17d01e4aa
Don't return NULL from mat4_invert;
2019-06-22 17:25:48 -07:00
bjorn
8d2f005bf3
Add stdlib.h to oculus_mobile;
2019-06-21 11:28:40 -07:00
bjorn
9f3638b018
TextureData:paste;
2019-06-20 23:36:18 -07:00
bjorn
7ebee200ea
rm strdup;
...
It isn't part of C, causing compiler errors on some platforms.
2019-06-20 22:21:31 -07:00
bjorn
879c789a08
Polyfill M_PI;
...
It technically isn't part of C, which is causing problems on some systems.
2019-06-20 21:43:40 -07:00
bjorn
807c519397
Fix typo;
2019-06-20 21:36:07 -07:00
bjorn
b6d65922af
Standard shader: spherical harmonics irradiance;
2019-06-20 21:17:32 -07:00
bjorn
286cb711e4
Standard shader: emissive;
2019-06-20 18:22:49 -07:00
bjorn
a9241e781b
Standard shader: emissive;
2019-06-20 18:20:07 -07:00
bjorn
179071023f
Standard shader: diffuse, specular, normal mapping;
...
No shader flags yet. Still need occlusion, emissive, configurable
lighting, IBL.
2019-06-20 17:46:22 -07:00
bjorn
b54f68a3d5
glTF: Support Textures with missing images and samplers;
2019-06-20 17:44:30 -07:00
bjorn
5881bdd5b1
Fix gpu timer array;
2019-06-20 14:44:28 -07:00
bjorn
4611b1c9a3
Add no-op standard shader;
2019-06-20 14:21:35 -07:00
bjorn
612f699aa4
Rename default shader to unlit;
2019-06-20 14:09:55 -07:00
bjorn
c10851d726
Fix tostring;
2019-06-20 13:47:43 -07:00
bjorn
d856f6d592
opengl: Create default texture at startup;
...
More predictable performance, fixes an obscure bug.
2019-06-20 11:35:46 -07:00
bjorn
6b2d06e766
Add lovrPlatformOpenConsole;
2019-06-16 18:55:43 -07:00
bjorn
eb1e257209
Add new array implementation; Upgrade filesystem;
...
Filesystem:
- Uses streaming file IO.
- Uses less memory when requiring files.
- Simplifies its require path implementation.
2019-06-16 13:30:30 -07:00
bjorn
f8f6d98df4
Use better default for identity quat;
2019-06-14 15:04:17 -07:00
bjorn
9e42fe295a
math.lua: Fix vec3:sub;
2019-06-14 13:30:07 -07:00
bjorn
9c322495fa
Fix bug when reading mat4s;
2019-06-14 13:22:13 -07:00
bjorn
2f3c23ed7e
Ensure getHands uses 4-element vec3;
2019-06-14 13:04:10 -07:00
bjorn
79083c7df1
Fix warnings on newer versions of gcc;
2019-06-11 19:57:20 -07:00
bjorn
909ee1ad79
Use highp in vertex shaders on GLES;
2019-06-10 08:12:36 -07:00
bjorn
de6d3dab5b
Add tup build system;
...
It's still a rough draft and likely only works on my machine, but can be
improved over time.
Rough explanation:
- tup.config contains high-level build configuration defaults.
- Tuprules.tup contains mostly compiler flags (generated from the
tup.config) and declares some macros used to compile code.
- Tupfile takes all generated object files and links them into the
lovr executable.
- src/Tupdefault defines the default build steps for src and all
subdirectories, which is to compile all .c files to .o files and put
them in the <objects> bucket for linking by the toplevel Tupfile.
It's possible to have multiple configs active at once for different
platforms, projects, etc. To do this, create a folder for each build
variant you want, and place a tup.config in each folder (it can be a
symlink, which is helpful). Then, invoking `tup` will build all your
variants, or you can build a specific one by doing `tup <foldername>`.
2019-06-10 04:06:22 -07:00
bjorn
31a1dc6cee
Details;
2019-06-10 03:39:53 -07:00
bjorn
e9853ed3c7
t.math.ffi conf flag;
2019-06-10 00:11:20 -07:00
bjorn
98f4365474
Add astc and dxt GraphicsFeatures;
2019-06-09 23:59:57 -07:00
bjorn
b0a7d5c122
ASTC textures;
...
I like typing numbers.
2019-06-09 09:11:29 -07:00
bjorn
0b5c609264
Add OpenVR touch bindings;
...
Untested.
2019-06-06 01:10:50 -07:00
bjorn
5551f76557
Reset render data when restarting in oculus_mobile;
...
Fixes a crash where rendering would occur with the old Lua state
after a restart.
2019-06-05 20:23:21 -07:00
bjorn
c0f4e2848b
Update android build;
2019-06-05 20:22:51 -07:00
bjorn
0c75f40793
rm the other restrict;
...
I guess it just isn't portable.
2019-06-04 04:43:02 -07:00
bjorn
feae7bdf3a
rm extra restrict qualifier;
...
Maybe this is confusing MSVC. Doesn't appear to impact codegen.
2019-06-04 04:20:23 -07:00
bjorn
d1f754d5f9
Fix Model memory leaks;
2019-06-03 08:13:42 -07:00
bjorn
06c6b172de
vec3 has 4 elements;
2019-06-03 07:20:03 -07:00
bjorn
31e086edaf
Inline all the maf functions;
2019-06-03 07:19:25 -07:00
bjorn
4eb03006d7
Fix SoundData loading;
2019-06-03 00:29:41 -07:00
Bjorn Swenson
68c1b6a201
Merge pull request #122 from bjornbytes/hand-updates
...
Hand updates
2019-06-03 00:14:45 -07:00
bjorn
dc34ed4570
Start to trend towards 4-element arrays for vec3;
...
It will be important for enabling more SIMD.
2019-06-02 20:35:52 -07:00
bjorn
c7a2e513d3
Inline hash function;
2019-06-02 04:15:46 -07:00
bjorn
575552a147
Restart hotkey works on default error screen;
2019-06-02 03:29:34 -07:00
bjorn
374492c586
Add experimental hotkeys flag;
...
- Add t.hotkeys flag to conf.lua, which defaults to true.
- If t.hotkeys is truthy, the following hotkeys will be enabled:
- Escape: Quit the experience
- F5: Restart the experience
2019-06-02 03:00:12 -07:00
bjorn
cf7a738a9f
Fix openvr.c;
2019-06-02 02:27:19 -07:00
bjorn
83c2d3ceef
Optimize timer module slightly;
2019-06-02 02:02:15 -07:00
bjorn
22fe333150
Update refcounting (again);
...
- Ref struct only stores refcount now and is more general.
- Proxy stores a hash of its type name instead of an enum.
- Variants store additional information instead of using a vtable.
- Remove the concept of superclasses from the API.
- Clean up some miscellaneous includes.
2019-06-02 01:02:26 -07:00
bjorn
d2bff7d239
lovr.graphics.tick and tock;
...
Initial support for GPU timer queries.
2019-06-01 17:29:53 -07:00
bjorn
84bd50379d
Add primary button/axis;
...
It's called "primary".
2019-05-31 12:00:15 -07:00
bjorn
7ac3d6938b
rm TRACKER devices for now;
...
This is not the correct way to expose them. It doesn't seem like
there is consensus on how to expose them yet. At the very least
LÖVR should instead use the hardcoded OpenVR tracker paths like
/camera, /keyboard, /foot/left, /foot/right, etc.
See these issues:
- https://github.com/ValveSoftware/openvr/issues/1030
- https://github.com/ValveSoftware/openvr/issues/962
2019-05-31 10:57:29 -07:00
bjorn
9674276ff7
Add lovr.headset.getHands;
...
The iterator is nice and concise, but a table is more conventional
and allows you to easily retrieve the number of tracked hands. The
iterator version may be removed in favor of the table version, since
you can always iterate over a table yourself.
2019-05-31 10:52:31 -07:00
bjorn
af0678f9e9
rm DEVICE_HAND;
...
If we expose both unhanded hands and handed hands, people need to
deal with handling (haha) both cases in their apps. It's simpler
to always deal with left and right hands, even though it is a bit
less general. Still, this is congruent with the current state of
OpenVR and OpenXR, and I think there are still open questions about
the more uncommon cases where there are more than two hands.
2019-05-31 10:41:40 -07:00
bjorn
fe559903e1
Oculus Go controller has handedness;
2019-05-31 10:37:43 -07:00
bjorn
d11e9be175
Lua userdata store their destructor in their metatable;
2019-05-28 16:31:13 -07:00
Bjorn Swenson
5ec6f1d1d1
Merge pull request #120 from mcclure/oculus-quest
...
Oculus quest support
2019-05-28 16:30:17 -07:00
mcc
1449d4c914
Oculus mobile: Support getAcceleration
2019-05-28 18:59:05 -04:00
bjorn
06e3ef702c
Add built-in ShaderFlag for skinning vertices;
...
Now you can pass in the { skinned = true } flag when creating a Shader
to get skinning behavior without needing to write it yourself. The
default is still false.
Need to profile to make sure the if is getting optimized out.
2019-05-28 03:43:54 -07:00
bjorn
c5210deae8
Fix ShaderFlag parsing;
2019-05-28 03:43:12 -07:00
bjorn
f3d31cf4ef
Add multiview and timer query extensions;
2019-05-28 03:14:08 -07:00
bjorn
1cfc2adf4a
Fix typo;
2019-05-28 02:45:08 -07:00
bjorn
6b439327fa
Make refcounts atomic;
2019-05-28 02:43:15 -07:00
bjorn
29b2420dea
Work around macOS flicker bug;
...
At this point I don't know if maybe I'm just using UBOs wrong but whatever.
2019-05-27 19:05:47 -07:00
bjorn
4221c547d7
glTF: Add support for base64 buffer data;
2019-05-26 21:13:59 -07:00
bjorn
56f4c812ce
Small intermediate fix for models without animators;
2019-05-26 21:12:07 -07:00
bjorn
d08c454f46
Fix sign issue in rasterizer;
...
Fixes missing glyphs.
2019-05-26 12:51:25 -07:00
mcc
f4189d13e8
Oculus Mobile fixes: Fix potential crash, fix touches on Go after Quest changes
2019-05-26 11:17:49 -04:00
mcc
991b35a628
Oculus mobile: revamp bridge to support Oculus Quest
2019-05-26 10:29:42 -04:00
bjorn
0b8bc4145e
openxr: Begin the session at the correct time;
2019-05-25 20:15:42 -07:00
bjorn
b26e29cb7b
Fix more LuaJIT math casts;
2019-05-24 20:54:38 -07:00
bjorn
831ebda303
Fix LuaJIT Pool integration;
2019-05-24 20:39:05 -07:00
bjorn
d5ad10f408
Permit symbolic links in lovr.filesystem;
...
If needed, it can be made configurable later.
2019-05-24 19:16:43 -07:00
bjorn
9b6f7c35b4
Fix lovr.headset.isTouched;
2019-05-24 15:14:20 -07:00
bjorn
3bf08f0ca3
Add the ability to create default shaders;
...
lovr.graphics.newShader('font')
2019-05-22 18:00:02 -07:00
bjorn
c464bde609
Add DefaultShaders enum;
2019-05-22 16:36:40 -07:00
bjorn
db5076a100
Rename SHADER_DEFAULT to SHADER_UNLIT;
2019-05-22 16:34:57 -07:00
bjorn
3dc4d06285
Fix eye enum;
2019-05-22 14:37:46 -07:00
bjorn
698466d19c
Add missing include in animator.h;
2019-05-21 00:32:20 -07:00
bjorn
5b1e281d4c
Switch to a fork of LuaJIT that supports android;
2019-05-21 00:26:21 -07:00
bjorn
3804a1c0ee
lovrPlatformGetName;
...
Used in lovr.getOS.
2019-05-20 20:44:39 -07:00
bjorn
4cc154fdfa
More number conversions;
2019-05-20 20:35:07 -07:00
bjorn
e4c32d2f08
Fix oculus_mobile api.h include;
2019-05-20 15:17:38 -07:00
bjorn
e87b81e34a
Fix android platform include order;
2019-05-20 15:16:27 -07:00
bjorn
a9972a88de
Fix oculus_mobile_bridge include path;
2019-05-20 15:15:10 -07:00
bjorn
e8a8f6718e
Fix vrapi_getAxis;
2019-05-20 15:13:05 -07:00
bjorn
df6b7fc96a
Ref is mostly private now;
...
It's really nice how objects don't need to care about how they're
allocated/managed now.
2019-05-20 15:09:06 -07:00
bjorn
57aad490ae
Start sized int conversions;
2019-05-20 14:34:03 -07:00
bjorn
c31853a1d4
Fix build;
2019-05-20 14:31:46 -07:00
bjorn
67b76e08c2
Details;
2019-05-20 04:15:24 -07:00
bjorn
e368723248
Improve platform-specific defines;
2019-05-20 04:05:39 -07:00
bjorn
67ddefd0c2
Ensure platform functions have prefix;
2019-05-20 04:02:25 -07:00
bjorn
b1e848ef6b
Cleanup filesystem module;
2019-05-20 03:51:22 -07:00
bjorn
1335ab55ae
Warnings/cleanup;
2019-05-20 03:41:12 -07:00
bjorn
7645f4c014
Add core folder;
2019-05-20 02:47:33 -07:00
bjorn
a17f10e273
Add modules folder;
2019-05-19 00:38:35 -07:00
bjorn
4a47afca38
Organize api folder;
2019-05-19 00:31:42 -07:00
bjorn
79ba7a7ad5
gltf: Support partially-keyed animation properties;
2019-05-18 22:19:28 -07:00
bjorn
8d1b335da4
More mapping fixes;
2019-05-18 21:34:36 -07:00
bjorn
440b30df59
Add filter/wrap to default texture;
2019-05-18 04:33:28 -07:00
bjorn
1792f066f2
Fix CMakeLists; Fix buffer unmapping; Formatting;
2019-05-18 01:09:06 -07:00
bjorn
e3e52a7808
Fix issue when animated model has no animator;
2019-05-18 00:30:43 -07:00
bjorn
976d59e364
Undo single-translation-unit experiment for now;
2019-05-17 16:29:24 -07:00
bjorn
6f7c30e7e2
Single-translation-unit experiment;
2019-05-15 12:05:56 -07:00
bjorn
1aef9963f5
Clean up thread module;
2019-05-14 04:43:38 -07:00
bjorn
a4e563fe6f
Clean up event module;
2019-05-14 04:37:56 -07:00
bjorn
3267bad4fa
Add ShaderFlags;
...
newShader and newComputeShader accept an optional options table
that can contain a table of flags. Flags are turned into #defines
in the shader source and can be used as specialization constants in
the future.
Currently they can only be bools and ints. This might change to add
float and/or remove bools.
2019-05-14 03:48:01 -07:00
bjorn
6134abe866
Handle vsync better;
...
- Add vsync flag to t.window and lovr.graphics.createWindow.
- vsync is 1 by default.
- Some headset drivers override vsync if they have special timing requirements.
2019-05-14 00:18:22 -07:00
bjorn
15c4b6fcd2
Fix me ifdefs;
2019-05-13 20:52:11 -07:00
bjorn
f786c40b4e
Rework Buffer updates;
...
Use unsynchronized mapped buffers on macOS.
Reduce amount of Buffer flushes and stalls by flushing once per
batch instead of once per draw.
2019-05-13 20:35:21 -07:00
bjorn
b8ed63fcc4
Fix double/float conversions;
2019-05-13 04:28:57 -07:00
bjorn
566cd20984
Cleanup;
2019-05-13 04:25:34 -07:00
bjorn
69260cfbb3
openvr: rm state.rift;
...
Yay actions?
2019-05-13 04:25:34 -07:00
bjorn
8e7a4323d0
rm custom PI define;
2019-05-13 03:56:34 -07:00
bjorn
83b8ee2d08
Audio cleanup;
2019-05-13 03:53:17 -07:00
bjorn
97e3774718
Make TimerState private;
2019-05-13 03:35:41 -07:00
bjorn
963f496ac1
Lua hides a Type in its userdata;
2019-05-13 03:21:11 -07:00
bjorn
429efcb38d
Change circle size argument from diameter to radius;
2019-05-12 23:34:04 -07:00
bjorn
51ce0c1418
rm compat;
2019-05-12 22:28:02 -07:00
bjorn
7c2a119324
SteamVR Input
2019-05-12 22:23:28 -07:00
bjorn
c20554645e
Initial KTX support;
2019-05-12 22:23:28 -07:00
bjorn
5b0fa8b522
Fix warnings;
2019-05-12 22:23:28 -07:00
bjorn
9a1579a773
Ensure maf symbols are exported on unix;
2019-05-12 22:23:28 -07:00
bjorn
db3c3dbb1e
Fix lovr.headset.hands;
2019-05-12 22:23:28 -07:00
bjorn
ebcdc6d36e
Ensure bone pose gets reset when not animating;
2019-05-12 22:23:28 -07:00
bjorn
28c453075a
Fix batching overflow;
2019-05-12 22:23:28 -07:00
bjorn
511afef0c6
Fix batching issue with non-instanced primitives;
2019-05-12 22:23:28 -07:00
bjorn
6ff35420bd
More leap fixes;
...
Also reduce branching in headset accessors.
2019-05-12 22:23:28 -07:00
bjorn
06b8b6f405
Leap fixes;
2019-05-12 22:23:28 -07:00
bjorn
26c1859531
Update WebVR;
2019-05-12 22:23:28 -07:00
bjorn
9382afb94d
Put controller models back on nogame screen;
2019-05-12 22:23:08 -07:00
bjorn
2ecae65925
trackpad -> touchpad;
...
Sorry
2019-05-12 22:23:02 -07:00
bjorn
57321db2cd
lovr.headset.getDriver accepts devices;
2019-05-12 22:23:02 -07:00
bjorn
5413f6a427
Device iterators;
2019-05-12 22:23:02 -07:00
bjorn
7807b1abd7
lovr.headset.getAcceleration, getAngularAcceleration;
...
Add missing getBonePose impls.
Refactor some ovr stuff.
2019-05-12 22:23:02 -07:00
bjorn
b6e1e5e3b0
lovr.headset.getBonePose; Device shorthands;
2019-05-12 22:23:02 -07:00
bjorn
05f4ba7342
Change everything;
...
Use enums because they make things easier.
2019-05-12 22:23:02 -07:00
bjorn
1d079f0c95
Fix desktop_isDown;
2019-05-12 22:23:02 -07:00
bjorn
e21b64155a
Re-prefix headset backend function names;
2019-05-12 22:23:02 -07:00
bjorn
89ccf750ba
Start compat system;
2019-05-12 22:23:02 -07:00
bjorn
4b3e72a5f1
Fix warnings;
2019-05-12 22:22:29 -07:00
bjorn
2aace190fe
Add oculus:getDisplayTime;
2019-05-12 22:22:29 -07:00
bjorn
5947a96556
Fix getDisplayTime prototype;
2019-05-12 22:22:29 -07:00
bjorn
c2fc7daf2d
Split mat4_getTransform;
2019-05-12 22:22:29 -07:00
bjorn
801f997b0a
Use vectors for headset pose accessors;
2019-05-12 22:22:29 -07:00
bjorn
344edd8c30
Add missing OpenXR string constant;
2019-05-12 22:22:29 -07:00
bjorn
dafa7fefbe
Fix setTransform;
2019-05-12 22:22:29 -07:00
bjorn
5ff8e51d88
Add openxr:getDisplayTime;
2019-05-12 22:22:29 -07:00
bjorn
ed725927c3
OpenXR headset backend;
2019-05-12 22:22:29 -07:00
bjorn
aa1d33669c
Just use leap;
2019-05-12 22:22:29 -07:00
bjorn
e22d98e09e
Finish Leap backend;
2019-05-12 22:22:29 -07:00
bjorn
5ff49e73c2
Leap WIP;
2019-05-12 22:22:29 -07:00
bjorn
400598735c
rm isTracked for now;
2019-05-12 22:22:29 -07:00
bjorn
df5de9a35e
Use strings for paths;
...
It's probably slower, but it's way less complicated, so it seems like
a win for now. Can implement compile-time hashing, tries etc. later
if it's identified as a performance issue for a real person.
Also a bunch of cleanup in openvr.c and oculus.c.
2019-05-12 22:22:29 -07:00
bjorn
45931d005a
lovr.headset.isTracked;
2019-05-12 22:22:29 -07:00
bjorn
bb06b211cd
Add missing getDirection binding;
2019-05-12 22:22:29 -07:00
bjorn
5c6163580b
rm unused headset.h;
2019-05-12 22:22:29 -07:00
bjorn
d8581106d4
Support Vive trackers again;
...
/trackers/1
2019-05-12 22:22:29 -07:00
bjorn
ca30991b2a
"VR Simulator" -> "Simulator";
2019-05-12 22:22:29 -07:00
bjorn
85d461e71c
Fixup lovr.headset.getName;
2019-05-12 22:22:29 -07:00
bjorn
50e77fc023
Combine getVelocity and getAngularVelocity impls;
2019-05-12 22:22:29 -07:00
bjorn
a9ef3656a1
lovr.headset.getDirection;
2019-05-12 22:22:29 -07:00
bjorn
965f39f834
Do less work in lovr.headset.getPosition/getOrientation;
2019-05-12 22:22:29 -07:00
bjorn
9a8b119a81
Add missing enum;
2019-05-12 22:22:29 -07:00
bjorn
42ba6ddbb9
oculus_mobile build fixes;
2019-05-12 22:22:29 -07:00
bjorn
7a5ae2bfe1
Update oculus_mobile backend;
2019-05-12 22:22:29 -07:00
bjorn
77f848ea8f
Update oculus backend;
2019-05-12 22:22:29 -07:00
bjorn
f5b976cfae
Actually read paths in API;
2019-05-12 22:22:29 -07:00
bjorn
e406678b1c
rm luax_pushpath;
2019-05-12 22:22:29 -07:00
bjorn
2584809c23
Reorganize path enum;
2019-05-12 22:22:29 -07:00
bjorn
4edb8de0b0
Shorten path enum prefix;
2019-05-12 22:22:29 -07:00
bjorn
86537141ac
Add eye path;
2019-05-12 22:22:29 -07:00
bjorn
b42c3ffc0e
Rename hands to hand;
2019-05-12 22:22:29 -07:00
bjorn
6182ce59af
Cleanup;
2019-05-12 22:22:29 -07:00
bjorn
4e8d64a1a3
Cleanup;
2019-05-12 22:22:29 -07:00
bjorn
60d2111937
Add proximity to Subpaths;
2019-05-12 22:22:29 -07:00
bjorn
87d3c2742c
Drop static function prefixes;
2019-05-12 22:22:29 -07:00
bjorn
b0067233f7
getType -> getName;
2019-05-12 22:22:29 -07:00
bjorn
b9c5dce584
re-add proximity sensor button;
2019-05-12 22:22:29 -07:00
bjorn
fd985c95ff
rm isMounted;
2019-05-12 22:22:29 -07:00
bjorn
da6fd4d07c
Remove Controllers;
2019-05-12 22:22:29 -07:00
bjorn
bd609fc338
rm Controller:getHand;
2019-05-12 22:21:06 -07:00
bjorn
cb0a40a4b6
lovr.headset.isDown; lovr.headset.isTouched;
2019-05-12 22:21:06 -07:00
bjorn
45757f2fa3
Fixes;
2019-05-12 22:21:06 -07:00
bjorn
b95280006a
lovr.headset.newModel;
2019-05-12 22:21:06 -07:00
bjorn
cb79973b98
lovr.headset.vibrate;
...
Signature changed to take strength, duration, and frequency. All
are optional.
2019-05-12 22:21:06 -07:00
bjorn
36e4529dca
lovr.headset.getAxis;
...
Takes a path and returns 1-3 float values representing the components
of the axis at the path. The "touchx" and "touchy" axes are now just
"touchpad".
2019-05-12 22:21:06 -07:00
bjorn
5ab8904809
Controller polyfill; rm Controller pose functions; OpenVR paths;
2019-05-12 22:21:06 -07:00
bjorn
f87b4e6a25
Read paths; Desktop driver uses paths;
2019-05-12 22:21:06 -07:00
bjorn
48cf7e1874
Start paths;
2019-05-12 22:21:06 -07:00
bjorn
8208238df7
Support multiple tracking drivers;
...
Now the lovr.headset module initializes one display driver (the
first one in the list) and multiple tracking drivers. Only drivers
that implement 'renderTo' will be considered for display driver.
Tracking drivers are stored in a linked list, and retrieving pose
information involves trying all of the tracking drivers until the
pose is found.
2019-05-12 22:21:06 -07:00
bjorn
c95c0afb4c
Set alpha sampling to false in lovr.graphics.reset;
2019-05-08 20:09:42 -07:00
bjorn
c9775c84ac
Remove t.gammacorrect flag;
...
Gamma correct rendering is core in all supported OpenGL versions,
and it's usually a good idea to enable it.
2019-05-03 17:53:33 -07:00
bjorn
594921d2ec
newThread: can load thread code from a file or Blob;
...
Also fix a lifetime issue: If the string containing thread code was
garbage collected before you started the thread, you would have been
running free'd memory as Lua code!
2019-05-02 15:09:54 -07:00
bjorn
0e0cfee6e8
Font:getWidth returns lineCount;
2019-04-27 11:13:37 -07:00
bjorn
7eff3d7d4c
rm platform include;
2019-04-23 15:26:45 -07:00
bjorn
8af82d3bc1
Handle mipMapCount = 0 in DDS textures;
2019-04-23 15:25:31 -07:00
bjorn
afc8000fc7
rm stddef from util;
2019-04-21 11:52:04 -07:00
bjorn
c021afedae
Fix more warnings;
2019-04-20 18:42:25 -07:00
bjorn
7af5b9816a
Stupid float stuff;
...
I'm sorry.
2019-04-20 17:02:48 -07:00
bjorn
2dea0eacfb
Use -fvisibility=hidden to hide symbols by default;
...
This saves some space, and it's better to be conscious about symbol exports.
2019-04-20 16:20:05 -07:00
bjorn
b95c97ff57
rm unused mat4_setTransform function;
2019-04-20 14:15:43 -07:00
bjorn
0341233876
Also support hexcodes in lovr.graphics.clear;
2019-04-20 13:38:09 -07:00
bjorn
c247682653
BRING BACK HEXCODES;
2019-04-20 13:36:36 -07:00
bjorn
f268810d2a
Minor cleanup; Fix some undefined behavior;
2019-04-20 13:11:11 -07:00
bjorn
ec7b2c0b68
Formatting;
2019-04-20 12:07:26 -07:00
bjorn
ec7afed2cb
Update one trailing reference to lib/math.h;
...
In a comment...
2019-04-20 11:41:29 -07:00
bjorn
196b4ed010
Rename math to maf;
...
It's funnier and more compatible with some compiler setups,
since it won't get confused with the system <math.h>.
2019-04-20 11:39:20 -07:00
bjorn
26435be7ac
Fix batching edge case;
2019-04-14 13:47:02 -07:00
bjorn
9d90e83657
Fix Mesh attribute normalization;
...
Normalize i8 and u8 attribute by default.
Forward attribute normalization from glTF accessors.
2019-04-13 16:08:58 -07:00
bjorn
ed92c4e6db
font:setFlipEnabled(false) in lovr.errhand;
...
To prevent text from being upside down if you flipped the default font.
2019-04-13 15:40:47 -07:00
bjorn
44be3608a7
lovr.headset.getDirection; Controller:getDirection;
2019-04-12 15:08:45 -07:00
bjorn
9131c26fab
Fix Android build;
2019-04-11 15:26:59 -07:00
bjorn
c89a7139ee
Add File to the types table;
2019-04-11 15:20:21 -07:00
bjorn
1e05799669
More conservative buffer locking;
2019-04-11 08:35:55 -07:00
bjorn
ee8fdb773d
Add missing Texture release in OpenGL state backdoor;
2019-04-08 05:19:39 -07:00
bjorn
59e4a5bb8e
Oops, re-enable graphics module in boot.lua;
...
Also change format of message.
2019-04-08 05:18:28 -07:00
bjorn
0f6bcad90b
Nogame screen works without the graphics module;
2019-04-08 03:25:45 -07:00
bjorn
0139486f46
Fix misc builds;
2019-04-05 06:07:46 -07:00
bjorn
6e75ebafac
Fix windows build;
2019-04-05 06:01:12 -07:00
bjorn
fa4f240b7b
Fix plane uv argument parsing;
2019-04-05 05:50:43 -07:00
bjorn
011db5f1e5
Revert "Free objects in their destructors;"
...
This reverts commit d31dca5520
.
We can't unconditionally free because sometimes objects are temporarily
allocated on the stack.
2019-04-05 05:45:05 -07:00
bjorn
a5891bad92
lovr.graphics.plane uv arguments;
2019-04-05 05:34:28 -07:00
bjorn
0b62960472
Use lovrVariantDestroy in lovrChannelClear;
2019-04-05 05:15:17 -07:00
bjorn
32f73bcbf5
Add missing struct tag;
2019-04-05 05:13:09 -07:00
bjorn
5e74222a48
rm types from util;
2019-04-05 05:12:21 -07:00
bjorn
c20c94b3e1
thread: forward declarations;
2019-04-05 05:11:49 -07:00
bjorn
bd21c24403
physics: forward declarations;
2019-04-05 05:10:21 -07:00
bjorn
2d98d2fb30
math: forward declarations;
2019-04-05 05:09:34 -07:00
bjorn
941fc1717f
headset: forward declarations;
2019-04-05 05:08:03 -07:00
bjorn
ee27af1a85
graphics: forward declarations;
2019-04-05 04:59:14 -07:00
bjorn
323f9b3fb0
filesystem: forward declarations;
2019-04-05 04:34:21 -07:00
bjorn
66b7288764
event: forward declarations;
2019-04-05 04:32:58 -07:00
bjorn
9e7b9642de
data: forward declarations;
2019-04-05 04:27:48 -07:00
bjorn
0d30448bd0
audio: forward declarations;
2019-04-05 04:16:34 -07:00
bjorn
8df55795b1
rm stdint from util;
2019-04-05 04:08:06 -07:00
bjorn
410a2810cf
Move types into their own file;
2019-04-05 04:05:03 -07:00
bjorn
14cab6cd3c
Move utf helper into lib;
2019-04-05 04:04:52 -07:00
bjorn
86a342877f
rm nextPo2;
2019-04-05 03:56:56 -07:00
bjorn
d31dca5520
Free objects in their destructors;
2019-04-05 03:56:10 -07:00
bjorn
ae470d8804
Make registertype/extend type a macro;
...
Just a nice-to-have.
2019-04-05 03:48:36 -07:00
bjorn
6fdeda9e61
Make lovrRelease non-generic;
...
We know what type we're releasing 99% of the time, we don't need to
play a guessing game in lovrRelease, just have the caller say which
destructor to use.
There is lovrGenericRelease for situations where we need it, which
does the slower lookup of the destructor.
2019-04-05 03:41:03 -07:00
bjorn
7932ef6f9f
Add type lookup;
...
Now Ref has a type id instead of a destructor/name, and use the type to
lookup the destructor and name when needed.
This improves performance, since now Ref contains a lot less data and we
can do an integer comparison instead of a string comparison when reading
objects from Lua.
2019-04-05 02:54:54 -07:00
bjorn
64b7ee85f7
Fix rendering with vertexCount of 0;
2019-04-05 01:28:17 -07:00
bjorn
c2c4322e3b
Add drawMode to lovrModelDraw Batch;
2019-04-05 01:23:48 -07:00
bjorn
a28b333899
Split draw data stream into two streams;
...
Also the max number of draws can be hardcoded to 256 now.
2019-04-05 00:49:50 -07:00
bjorn
88b54a7ab9
Make cursors generic;
2019-04-05 00:49:50 -07:00
bjorn
efbc88073e
Write vertices at batch time;
2019-04-05 00:49:50 -07:00
bjorn
7409f34d36
lovr.graphics.getStats does a flush;
2019-04-01 07:37:05 +09:00
bjorn
ab42e2ca18
Fix bug when reading point/line/triangle primitive data;
...
- When reading points from a table of numbers, the array
indexing was not correct and vertex positions were not
getting correctly written.
- The normals/texture coordinates weren't getting written,
so their values were using whatever was in the buffer.
Now they are always set to zero.
2019-03-31 00:23:02 +09:00
bjorn
10305a4fed
Fix batching problem;
2019-03-25 11:36:29 +09:00
bjorn
793dca03d1
Fix resulting clang warnings;
2019-03-17 01:01:54 -07:00
bjorn
85c51399a6
Fix MSVC warnings;
2019-03-17 00:58:13 -07:00
bjorn
a9ca346ee1
Fix base path in model loaders;
2019-03-16 22:03:00 -07:00
bjorn
9744d95039
Fix snprintf warning;
...
There's a potential string truncation here if you have a uniform array with a really long name.
2019-03-16 19:43:04 -07:00
bjorn
7441456aab
Rename lovr.graphics.getSupported and getSystemLimits;
...
"Features" and "Limits" will be the standard terminology used now.
2019-03-14 21:24:25 -07:00
bjorn
25fe88b493
Limit UBO size in WebGL;
...
Currently glBindBufferRange does not seem to work properly if the
offset is bigger than the maximum size of a uniform buffer. The
size of the draw data buffer is being limited as a workaround.
2019-03-14 13:40:19 -07:00
bjorn
1d7e8519d6
Organize luax_setmainthread;
2019-03-14 13:36:51 -07:00
bjorn
12cf311490
Use mipmaps and filtering for OpenVR Canvas;
...
It leads to a prettier mirror window. There is some performance overhead, that can be dealt with as needed.
2019-03-13 20:44:15 -07:00
bjorn
bf5dd56254
vec3:add and vec3:sub accept numbers;
2019-03-13 20:36:50 -07:00
bjorn
8722b6e296
Improve Canvas attachment errors;
2019-03-13 09:35:28 -07:00
bjorn
c1705da8b7
Improve shader compilation error;
2019-03-13 09:31:06 -07:00
bjorn
e008ea7a28
Consistency;
2019-03-13 09:21:14 -07:00
bjorn
94ac64e7f4
Add std140 layout qualifier to DrawData block;
2019-03-13 09:20:33 -07:00
bjorn
ce20447260
Use proper ifdefs for LOVR_WEBGL;
2019-03-12 13:18:14 -07:00
bjorn
a14e15f856
Only fence when needed;
...
There appears to be some sort of problem where syncing on WASM and
Android leads to dropped frames. The only sync that causes this
problem is the delayed sync that occurs after rolling over a
buffer -- in that case the sync is often placed one frame late
once we realize that the rollover has occurred. I'm not sure if
this is a driver quirk or an improper use of glFenceSync but for
right now avoiding the fence on the problematic platforms fixes
the immediate issue.
2019-03-12 13:09:21 -07:00
bjorn
921d14014e
TextureData:setPixel supports more formats;
2019-03-11 13:36:22 -07:00
bjorn
cf5ad64deb
WebVR: Use new dynCall syntax for function pointers;
2019-03-09 03:00:50 -08:00
bjorn
b513990095
Allocate oculus mobile Canvas on stack;
2019-03-07 04:47:08 -08:00
bjorn
843a7b2462
Remove angle conversion in oculus_mobile;
...
Relies on a separate fix in lovr-oculus-mobile.
2019-03-07 03:20:23 -08:00
bjorn
9e6ead30e7
Oculus mobile formatting;
2019-03-07 03:19:50 -08:00
Bjorn Swenson
0927df8246
Merge pull request #116 from bjornbytes/headset-render-error
...
Refactor asynchronous headset render errors;
2019-03-07 01:24:09 -08:00
bjorn
9313394e22
Call coroutines T;
2019-03-07 01:19:40 -08:00
bjorn
b28face914
Handle coroutine stuff properly;
2019-03-07 01:04:45 -08:00
bjorn
e24a80685b
Update stb_image_write;
...
And disable stdio support for it, since it isn't needed.
2019-03-07 00:02:11 -08:00
bjorn
ce029cb5c5
Fix emscripten; Properly clear error on Android;
2019-03-06 23:17:29 -08:00
bjorn
569c9f7a11
Refactor asynchronous headset render errors;
...
It's now a more general error stored in the registry instead of
in a global variable. There are more helper functions.
2019-03-06 23:17:29 -08:00
bjorn
d45e56146a
Rename fake to desktop;
2019-03-06 23:02:47 -08:00
Bjorn Swenson
86ef954287
Merge pull request #111 from mcclure/oculus-fix-19feb
...
Fix Oculus driver compilation
2019-03-06 22:25:31 -08:00