Blender Git Loki

Blender Git "vamr-openxr-module" branch commits.

Page: 6 / 10

July 10, 2019, 21:53 (GMT)
Refactor GHOST_XrContext into class + interface

Makes GHOST_Xr much more consistent with the rest of GHOST. Basically I
added a GHOST_IXrContext interface which can be called by the GHOST
C-API. The internal GHOST_XrContext class implements this.
Outside of GHOST only the opaque GHOST_XrContextHandle is accessible.

Kept GHOST_Xr_intern.h and GHOST_Xr.cpp for now. I'll probably remove
them soon. There's not much reason for both of them to be there.
July 10, 2019, 13:08 (GMT)
Use OpenXR extension for extra debug messages in debug mode

Enables (or tries to) the XR_EXT_debug_utils extension which allows
setting a custom callback for additional debug prints. Note that I
haven't been able to test this really, as the Monado runtime appears to
not have this fully implemented (had to force sending a custom message
to find that out...). Will test with the Windows MR runtime in a bit. We
can also improve message quality then (it can print the exact function
name the message was sent from, print additional custom labels which
could indicate session state, etc.).
July 10, 2019, 13:08 (GMT)
Only try to enable OpenXR API validation layer in debug mode
July 10, 2019, 13:06 (GMT)
Cleanup: Rename XR_DEBUG_BEGIN -> XR_DEBUG_ONLY_BEGIN

Of course also renames XR_DEBUG_END accordingly.
July 9, 2019, 15:49 (GMT)
Only print info messages with --debug-xr enabled
July 9, 2019, 15:20 (GMT)
Add --debug-xr commandline arg and pass on to GHOST XR contexts

Doesn't do anything yet.
July 9, 2019, 14:45 (GMT)
Preparations to allow enabling OpenXR API validation layer

For this to work two environment variables have to be set:
XR_API_LAYER_PATH and LD_LIBRARY_PATH, both have to point to the API
layers built by the OpenXR SDK. It also requires you compile Blender
linked to your own SDK build (OPENXR_USE_BUNDLED_SRC disabled).
Further changes will make this set up unnecessary, so validation layers
can be enabled via some flag.
July 9, 2019, 09:28 (GMT)
Fix warnings and compile error on GCC
July 9, 2019, 08:56 (GMT)
Enable grid floor in VR session

Helps quite a bit orientating.
July 8, 2019, 12:18 (GMT)
Merge branch 'master' into soc-2019-openxr
July 8, 2019, 12:13 (GMT)
Use base pose from Blender camera

I was trying to set the camera pose as OpenXR reference pose. But then I
got really strange poses for drawing back from OpenXR. Couldn't figure
out a way to solve this.
Now we just apply OpenXR's draw pose to the Blender camera pose. If we
later want to support moving around in the scene (e.g. via teleporting),
that has to be changed.

Also uses flipped drawing for DirectX surface to correct DirectX upside
down drawing (compared to OpenGL).
July 7, 2019, 11:07 (GMT)
Don't recreate reference local space on each redraw

Set this up on session start.
July 7, 2019, 10:45 (GMT)
Add GHOST_XrSession class for cleaner & safer session management

Session code and data structures are now localized. But also, this
enables sessions to use deterministic destruction to end itself cleanly.
So whenever an error occurs, we can use stack unwinding which will cause
graceful ending of the session.
July 3, 2019, 19:01 (GMT)
Properly end VR sessions fixing crash on next session start

Previously, you had to restart Blender to start another session.
July 1, 2019, 17:04 (GMT)
Cleanup GHOST_Xr types and functions

* Move GHOST_Xr types to GHOST_Types.h
* Add GHOST_XrPose. We'll have to pass around pose data at multiple
places.
* Don't require extra call to prepare session rendering, handle
everything through GHOST_XrSessionStart
* Naming
July 1, 2019, 13:57 (GMT)
Initial HMD viewport rendering (DirectX only first)

Finally: This makes it possible to render a viewport to an HMD via
OpenXR. Pure OpenGL rendering will need some more tweaks to work.
To my great delight, performance is quite good for reasonably sized
scenes.

Had to do some hacks and marked some TODOs. Nothing too bad though.

Here are a couple of notes:
* Current initial pose is pretty useless, think it just looks downwards
from world origin. Will change that soon.
* The rendered viewport has some issues: Too dark (bad lighting?), grid
doesn't show up even though I told it to, lighting seems to change with
view position/rotation, etc. Needs some polish.
* Ideally we'd just use the D3D11 Texture given to us via the OpenXR
swapchain and blit the OpenGL framebuffer into that. However the
NV_DX_interop extension fails doing this. Seems like this is a NVidia
Optimus only issue, but I'm missing the hardware to confirm.
So instead, we blit into the D3D11 back buffer first and then into the
Texture.
* The draw-manager uses its own offscreen context so we have to get the
render result from the draw-manager context to the VR session's
context first. Luckily I've already added code to support blitting from
one OpenGL context into another. But it requires blitting twice.
Blitting should be very cheap, but still...
Draw-manager could get a context to use passed instead.
June 29, 2019, 00:30 (GMT)
Draw offscreen viewport in XR session surface callback

Not visible yet, but it should draw in the offscreen. The way this is
now, we don't depend on the Window->Workspace->bScreen->... chain. We
simply draw an offscreen viewport in the draw callback of the XR session
surface.

The drawing also uses view and projection matrices from OpenXR (or
calculated from OpenXR data).
June 28, 2019, 20:53 (GMT)
Move WM level XR functions to wm_xr.c

Operator is still in wm_operators.c, but only calls wm_xr.c functions.
June 28, 2019, 14:24 (GMT)
Support Window-less (offscreen) VR session on Windows

Uses the new wmSurface type (non-window drawable container) to manage
the OpenGL, DirectX and GPU module contexts. The draw callback of the XR
surface calls the GHOST_Xr session drawing routines.

What you should see when starting a VR session now (using the WMR
runtime): The Windows Mixed Reality Portal pops up, and a blue
background is drawn on the HMD. This is from the blue color clear call
we do in the drawing preparations of the GHOST_Xr session drawing.
June 28, 2019, 12:09 (GMT)
Merge branch 'master' into soc-2019-openxr
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021