The message box is meant to be a hack to improve UX on Windows, not an
officially supported feature of core/os. So it's more appropriate to
inline it in the one place/platform where it's used.
GLFW reports window size as zero on Windows when the desktop window is
minimized. This is by design. Using zero width/height for window
textures isn't valid. The fix is to ignore resize events where the
width or height is zero and also cache the last-valid window size so it
can be reported by os_window_get_size. Sighs...
Currently I don't think there's a way for plugins to use JNI, because they
have no way to access the JavaVM or JNIEnv pointers. JNI_OnLoad is only
called for native libraries loaded by Java, and the plugin library has
no way of loading liblovr.so or accessing its symbols because the
library is inside the APK. This change emulates JNI_OnLoad as a means
of smuggling the JavaVM over to plugins before they're loaded. On
Android API level 31, the JNI_GetCreatedJavaVMs function was exposed on
Android, so that may be an alternative for plugins to use in the future.
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.