These are called when creating/destroying Thread objects. It's
currently only implemented on Android, where it attaches/detaches the
Java VM to the thread. This allows JNI calls to be used on threads.
However I don't think e.g. `lovr.system.requestPermission` will work on
a thread yet, because it uses the global JNI env from the main thread
instead of the thread's JNI env. Still, attaching/detaching the VM is
an improvement and will allow well-behaved JNI methods to work on
threads now.
I don't know how expensive this is, yolo.
Just draw a sphere. The transform is rotated so the sphere segments
line up better, because spheres and capsules use different orientations
for their sphere parts. Also the "degenerate" z axis is reconstructed
to be perpendicular to the x/z axes. This doesn't seem like it will be
particularly fast, but hopefully people aren't drawing zero-length
capsules too often. There might be an opportunity to shortcut the
rotation since it's 90 degrees and would just involve swapping columns.
- state.features.overlay should remain a bool since it just indicates
whether the extension is supported/enabled.
- split the config value into a bool/u32 pair so the full u32 range can
be used for the order (seems important to coordinate with other apps).
- Also you can use a boolean now like before, which uses 0 as the order.
- Add newSurface, which returns a "blank" surface, allowing you to set
your own properties.
- Add finalizeSurface, which sets computed surface properties and clamps
values to prepare for lighting.
- Add applyMaterial, which takes all of the properties in the material
and applies them to a surface
- Add helper functions for getting properties from the Material, which
combine scalar factors and texture samples while respecting shader
flags:
- getMaterialBaseColor
- getMaterialEmissive
- getMaterialMetalness
- getMaterialRoughness
- getMaterialOcclusion
- getMaterialClearcoat
- getMaterialClearcoatRoughness
- Add getDefaultSurface, which returns what initSurface would result in
today, deprecating initSurface.
- Last row of transform matrix is unused, make it 4x3
- Requires funny row-major packing due to vec3 std140 padding.
- Teach spirv parser to tolerate non-square matrix types, though
they aren't supported anywhere else yet.
- Compute cofactor in shader for normal matrix, ALU is free,
optimize out many terms, rm maf_cofactor.
- Take out complex UBO alignment logic since stuff is PO2 these days.
This was a common bottleneck for some workloads, so there are measurable
performance gains (up to 2x faster pass submission on CPU). GPU time is
identical, at least on desktop.
It's useful. quat(lovr.headset.getOrientation()):direction() is
verbose, noob-unfriendly, and somewhat wasteful. I think this was
originally removed because something about not exposing the full
rotation basis.
LOVR doesn't require OpenXR to run. When the headset module is enabled
and the openxr headset driver is enabled, LOVR tries to initialize
OpenXR, and if it fails then it will try the next driver.
The OpenXR loader will print error messages to stderr by default. This
is undesirable because someone who is unfamiliar with OpenXR will see a
bunch of messages in their console that say "ERROR" and think something
is wrong, even though the messages are innocuous and don't indicate an
actual problem.
The only way to silence these messages from the OpenXR loader, to my
knowledge, is to set the XR_LOADER_DEBUG environment variable to 'none'.
This is only done when the environment variable isn't set, so it's still
possible to set XR_LOADER_DEBUG to see the logs.
Most OBJ loaders use OpenGL texture coordinate conventions.
After switching to Vulkan, the UV origin became upper-left and images no
longer needed to be flipped on import. This means that the OBJ importer
now needs to flip its UVs to compensate. Somehow, no one noticed until
now! Most people are using glTF I guess.
Recent SteamVR versions have bugs with it, especially after triggering a
recenter operation.
In SteamVR, recentering fires referenceSpaceChangePending for the LOCAL
space, then the STAGE space, then the LOCAL space again, all with
different changeTimes. No poseInPreviousSpace is given.
Recreating the main reference space whenever this event is received
leads to strange, inconsistent issues. Sometimes the local/stage spaces
end up on top of each other, other times one or both will be way up in
the air (putting the headset at negative y coordinates).
This bug is even present when recentering in the compositor, so it's not
an issue with lovr. Cautiously disabling the local-floor emulation on
SteamVR runtimes and just always using the STAGE space until things are
sorted out.