Commit Graph

3460 Commits

Author SHA1 Message Date
bjorn 5d542eb2ea Minor Sound cleanup; 2021-02-24 14:11:49 -07:00
bjorn 7d0dfc9cdd Sound: Ambisonic support;
Add support for importing ambisonic WAV files and 24/32 bit PCM WAV files.

The standard ambisonic format used internally in LÖVR is ACN channel ordering with SN3D normalization.
Anything else will be converted to this form.

There are a few restrictions and assumptions:

- Only 1st order ambisonics are supported.  They need to have 4 channels.
- They can be in AMB format (Furse-Malham order/normalization), detected via WAVE_EXTENSIBLE GUID.
- Any other 4 channel file is assumed to be in "AmbiX" ACN/SN3D format.
  - It seems that most ambisonic files in the wild that claim to be AmbiX are just 4 channel WAVs without any metadata.
  - This means that non-ambisonic 4 channel WAVs could ambiguously be mistaken as ambisonic.  This is incurred as a limitation of LÖVR.
- Ambisonic files can not currently be played back.  SteamAudio currently has numerous bugs with this.
  - Perhaps it would be possible to write an ambisonic rotator/panning decoder to use as a default implementation.
2021-02-24 14:11:49 -07:00
bjorn 1d1a2de124 Only use CTZL in audio; 2021-02-24 14:11:49 -07:00
bjorn bff86e6add CMake: Add modelData_stl.c file; 2021-02-24 13:22:46 -07:00
bjorn 72a54bce2f Support STL models;
Only binary STL files are supported right now, ASCII is more challenging.
2021-02-23 12:07:16 -07:00
bjorn a430ae06b8 Early-reject OBJ files;
OBJ files must start with a vertex, object, mtllib, or comment.
2021-02-23 12:05:11 -07:00
bjorn f1922e22c8 Sharpen nogame screen; 2021-02-22 17:53:47 -07:00
bjorn 1145085446 macOS fixes; 2021-02-22 17:07:28 -07:00
bjorn fb1447503b Fix gcc warnings; 2021-02-19 23:44:23 -07:00
bjorn 5d5c79b5b1 Upgrade OpenVR; 2021-02-19 23:44:23 -07:00
bjorn ef438d48b3 Upgrade stb_vorbis; 2021-02-19 23:44:23 -07:00
mcc ffa63e9912 Allow the creation of a (potentially infinite-length) Sound created by a dynamically run callback 2021-02-19 21:30:16 -07:00
bjorn 57a215a0aa Minor MeshShape cleanup;
- Fix memory leak
- Minor error message improvements
2021-02-19 17:28:04 -07:00
bjorn 880d06a1d1 Only enable compute extensions on desktop GL; 2021-02-19 14:09:40 -07:00
bjorn 1757d30a59 Compute shader feature detection adjustment;
- Compute feature requires compute shaders, image load/store, and SSBOs.
- GLSL 330 is always used, instead of changing depending on compute shader extension.
- Explicitly enable compute shaders, image load/store, and SSBO extensions when needed.

This allows implementations that don't support GLSL 430 to run compute shaders,
and keeps the min supported GL version more consistently at GL3.3.
2021-02-19 14:07:27 -07:00
bjorn a0b2200bef Fix lovr.graphics.getBlendMode when blending is off; 2021-02-19 14:05:18 -07:00
bjorn 26d009aada Fix sample conversion when only channel count conversion is required; 2021-02-19 12:35:52 -07:00
bjorn 9c1af7427f Fix restart cookie on wasm; 2021-02-19 09:06:16 -07:00
bjorn a2b7e1619d Fix wasm compilation issues; 2021-02-19 09:05:57 -07:00
bjorn 0365f51f9d Fix crash when drawing zero lines; 2021-02-19 08:38:45 -07:00
bjorn 7ef215c312 simulator: fix aspect ratio; 2021-02-19 08:30:57 -07:00
bjorn 6c74a61ae3 simulator: Fix getDisplayDimensions;
getDisplayDimensions is supposed to return the dimensions of one eye.
2021-02-19 08:29:38 -07:00
bjorn 36170678f0 Sound: Change channel count to channel layout; 2021-02-18 21:17:25 -07:00
bjorn 08916df2f1 Tell spatializers about sources only when they're active;
apply will still only be called with sources after they have been created.
2021-02-18 20:49:20 -07:00
bjorn 952fee3bd1 Rework audio converters;
They are stored by value in the array so they are contiguous.

Source stores the index of its converter to save a bit of space and avoid realloc.
2021-02-17 22:47:50 -07:00
bjorn 7b7f6bbaeb Simplify FOREACH_SOURCE; 2021-02-17 22:36:24 -07:00
bjorn cb8a1e8962 Free playing Sources properly; 2021-02-17 22:31:03 -07:00
bjorn e9069335bb tup: Fix CONFIG_ANDROID_ASSETS; 2021-02-17 22:08:09 -07:00
bjorn 75fda2336f Enforce strict limit of 64 active sources;
If 64 sources are playing and a new one is started, Source:play will
return false.

Instead of a linked list, a static list of 64 Sources is used.

Bit scanning intrinsics are used to efficiently iterate the list,
using a mask (still deciding on this).
2021-02-17 20:46:33 -07:00
bjorn 4580107023 Update ODE with macOS fix; 2021-02-17 11:24:59 -07:00
bjorn ea64f32c1f Source:clone; 2021-02-16 21:34:53 -07:00
bjorn 8cc96847a8 Fix sign warnings; 2021-02-16 21:02:12 -07:00
mcc a3c76a95ab Two additional arguments to shaderBlock:send(): an offset and a size. If present, only part of the shaderBlock will be sent. 2021-02-16 17:26:18 -07:00
bjorn 72284c2c5b Merge branch 'master' into dev 2021-02-12 08:16:36 -07:00
bjorn 023067ec27 util.h no longer uses atomics; 2021-02-11 16:37:55 -07:00
bjorn b21fd987ca CMake: change msdfgen binary dir; tup: fix msdfgen path; 2021-02-11 16:19:35 -07:00
mcc 126ff0d8ba Fix build when LOVR_ENABLE_AUDIO is off
(Build miniaudio if LOVR_ENABLE_DATA is on)
2021-02-11 15:58:37 -07:00
bjorn 28e88d7598 Reorganize spatializer files/CMake; Oculus Audio tup support; 2021-02-10 12:41:15 -07:00
bjorn 6eb6ab221f CMake: Fix msdfgen target name; 2021-02-10 16:52:15 -07:00
bjorn 5ae5acfb18 Make Font texture rgba16f;
Sampling from rg11b10f does not appear to work on mobile.
2021-02-10 15:22:30 -07:00
bjorn 0919da4091 Improve MSDF font shader; Add spread/padding settings to Font; 2021-02-10 07:08:29 -07:00
bjorn 7b136b914c Update msdfgen;
- Rasterizer (maybe temporarily) uses 32 bit float textures.
2021-02-10 04:03:43 -07:00
bjorn e630cabdac CMake: Fix weird linux opengl warning; 2021-02-10 04:03:18 -07:00
bjorn f8ed6c3a34 physics: Use dReal in more places;
This makes it easier to swap between float/double.
2021-02-09 23:24:27 -07:00
bjorn 4f8fd7856b Fix minor Tuprules mistakes; 2021-02-09 23:00:33 -07:00
bjorn 51485f613c Add the ability to override Android package id; 2021-02-09 21:19:29 -07:00
bjorn b343f50f1c mv l_data_textureData->l_data_image; 2021-02-09 21:14:09 -07:00
bjorn e7adf62bfa Fix Android tup build; Reorganize Tuprules; 2021-02-09 21:09:09 -07:00
bjorn 351d1ae200 Fix vrapi includes; 2021-02-09 20:03:53 -07:00
bjorn 3e41a0c322 Small Tupfile cleanup; 2021-02-09 09:11:14 -07:00