Blender Git Commit Log

Git Commits -> Revision 2cedad9

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.

Commit Details:

Full Hash: 2cedad990a975185fc8a24efbd827c7fd93f650d
Parent Commit: 109be29
Lines Changed: +382, -85

20 Modified Paths:

/intern/ghost/GHOST_C-api.h (+11, -1) (Diff)
/intern/ghost/GHOST_IContext.h (+4, -0) (Diff)
/intern/ghost/intern/GHOST_C-api.cpp (+11, -0) (Diff)
/intern/ghost/intern/GHOST_Context.cpp (+4, -1) (Diff)
/intern/ghost/intern/GHOST_Context.h (+3, -3) (Diff)
/intern/ghost/intern/GHOST_ContextD3D.cpp (+141, -31) (Diff)
/intern/ghost/intern/GHOST_ContextD3D.h (+8, -3) (Diff)
/intern/ghost/intern/GHOST_ContextWGL.cpp (+9, -0) (Diff)
/intern/ghost/intern/GHOST_IXRGraphicsBinding.h (+2, -1) (Diff)
/intern/ghost/intern/GHOST_SystemWin32.cpp (+68, -2) (Diff)
/intern/ghost/intern/GHOST_XRGraphicsBinding.cpp (+43, -17) (Diff)
/intern/ghost/intern/GHOST_XRSession.cpp (+14, -10) (Diff)
/source/blender/draw/DRW_engine.h (+2, -0) (Diff)
/source/blender/draw/intern/draw_manager.c (+5, -0) (Diff)
/source/blender/editors/space_view3d/view3d_draw.c (+6, -0) (Diff)
/source/blender/makesdna/DNA_view3d_types.h (+1, -0) (Diff)
/source/blender/windowmanager/intern/wm_draw.c (+2, -0) (Diff)
/source/blender/windowmanager/intern/wm_surface.c (+8, -0) (Diff)
/source/blender/windowmanager/intern/wm_xr.c (+39, -16) (Diff)
/source/blender/windowmanager/wm_surface.h (+1, -0) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021