1
ACCELERATING YOUR VR APPLICATIONS WITH VRWORKS
Cem Cebenoyan Edward Liu
ACCELERATING YOUR VR APPLICATIONS WITH VRWORKS Cem Cebenoyan - - PowerPoint PPT Presentation
ACCELERATING YOUR VR APPLICATIONS WITH VRWORKS Cem Cebenoyan Edward Liu 1 ACCELERATING YOUR VR APPLICATIONS WITH VRWORKS Talk Overview VRWorks Overview Graphics, audio, video stitching, physics Lens Matched Shading Deep Dive
1
Cem Cebenoyan Edward Liu
2
Graphics, audio, video stitching, physics
Fundamental technology Engine integration details
Talk Overview
3
PHYSX
Bringing Reality to VR
SIGHT BEHAVIOR SOUND TOUCH
Simultaneous Multi-projection VRWorks 360 Video & CUDA PhysX Ray Traced Audio SIGHT SOUND PHYSICS & TOUCH CAPTURE
4
GRAPHICS CAPTURE AUDIO PHYSICS & TOUCH
5
TRADITIONAL = 60 MP/S
(1920 X 1080 @ 30 FPS)
VIRTUAL REALITY = 450 MP/S
(3024 X 1680* @ 90 FPS) 1920 1080 1512 1680 1512
*VR render resolution
Ultra-High Resolution and Frame Rate
6
Motion to Photon: ≤ 20 ms
Ultra-Low Latency
7
LCD display Optics User’s view
8
Warped Image Rendered Image
9
Rendered Image Warped Image
GPU renders many pixels that never make it to the screen
10
11 11
Renders to a lens corrected surface
12
Viewport 1 Viewport 2 Viewport N
Geometry Pipeline Fast viewport broadcast hardware on NVIDIA Maxwell and beyond GPUs
13 13
Requires 2 geometry passes
14 14
Renders left & right eye in one geometry pass
Left Eye Right Eye
15
Scales performance across multiple GPUs
Frame 1 (Left eye) Frame 1 (Right eye) Head Tracking (t) Warped Frame Head Tracking (t+1)
N N+1 N N+1 N N+1 CPU GPU 0 GPU 1 Display Latency GPUs render alternate frames
NL N+1R N N+1 NR N+1L N N+1 CPU GPU 0 GPU 1 Display Latency Each GPU renders one eye—lower latency
Shadow maps, GPU physics, etc. Left eye rendering Right eye rendering
UINT SetGPUMask( [in] UINT GPUMask ); void RenderGPUMaskNV( [in] bitfield mask );
GPU affinity masking: full control
Multi-GPU API
Engine
NvAPI_Status VSSetConstantBuffers( [in] ID3D11DeviceContext *pContext, [in] UINT GPUMask, [in] UINT StartSlot, [in] UINT NumBuffers, ); void MulticastBufferSubDataNV( bitfield gpuMask, uint buffer, intptr offset, sizeiptr size, const void *data );
Per-GPU constant buffers, viewports, scissors
0.0 0.4 0.8 1.2 1.6 2.0 Funhouse Everest Raw Data SportsBar VR Trials of Tatooine Without VRWorks With VRWorks
*Performance measured on GeForce GTX 1080 using VRWorks MRS, LMS, or VR SLI
Relative Performance
21 21
GRAPHICS / DISPLAY CAPTURE AUDIO PHYSICS & TOUCH
22 22
Creation of Source Sounds Location of Incoming Sound How Sound Moves in Space
DIRECTION PROPAGATION SYNTHESIS
23 23
Elevator Symphony Hall Meadow
24 24
25 25
26 26
Models direction and propagation using Ray tracing
27 27
Features:
Reflection, Diffraction, Transmission
Easy To Use Presets:
Available as SDK and Plugin for UE 4.15+
28 28
GRAPHICS / DISPLAY CAPTURE AUDIO PHYSICS & TOUCH
29
Collision detection & deformation modeling
FORCE FRICTION PhysX API PhysX Constraint Solver Haptics Layer RESTITUTION
30 30
PHYSX FLEX HAIRWORKS FLOW DESTRUCTION CLOTH
Simulating behavior in VR
31 31
32 32
GRAPHICS / DISPLAY CAPTURE AUDIO TOUCH / PHYSICS
33 33
Capture Stitch Display
Decode Calibrate Equalize Stitch Encode 4k cameras Single 360 video
34
Features
GPU Accelerated Pipeline
Decode -> Calibration -> Equalization -> Stitching -> Encode
Mono SDK Available in Beta Now! Stereo SDK Available Soon
"The fact that NVIDIA manages to stitch 4K 360 stereoscopic video in real time making live streaming possible changes the production pipeline and enables entirely new use cases in VR“ Kinson Loo, CEO of Z CAM.
35
Features:
Multi-res Shading Lens Matched Shading Single Pass Stereo VR SLI
Available for 4.12 through 4.15 Download at: developer.nvidia.com/nvidia- vrworks-and-ue4
36
Features:
Multi-res Shading Lens Matched Shading Single Pass Stereo VR SLI
Supported in Unity 2017.1 Beta 2 Download VRWorks plugin at www.assetstore.unity3d.com
37
38
39
40
41
42
Two effects of applying lens warp to an image: 1.Periphery squashed 2.Central region magnified This distortion makes image center undersampled and periphery supersampled
43
44
Therefore VR applications usually render at a higher resolution than display resolution.
Display Resolution 2160x1200, Render Resolution 3024x1680
Display Resolution 2160x1200, Render Resolution 2664x1586
45
46
LMS approximate post lens warp shading rate by:
w’ = Ax + By + w
47
LMS approximate post lens warp shading rate by:
w’ = Ax + By + w
48
LMS approximate post lens warp shading rate by:
w’ = Ax + By + w
49
LMS approximate post lens warp shading rate by:
w’ = Ax + By + w
50
51
52
We provide 3 sets of configurations for both HTC Vive and Oculus Rift 1.Quality:
No undersampling accross the image (while reducing total # of pixels)
2.Conservative:
Undersampling no worse than baseline
3.Aggressive:
¾ Resolution of the Conservative config (keeping center shading rate high)
53
We also provide a scalar variable that smoothly change the shading rate It keeps the center shading rate constant Allows finer grain tuning between image quality and performance
54
The 1/x profile of LMS can closer approximate the lens profile than the piecewise constant of MRS LMS needs fewer shading to achieve the same image quality with MRS LMS has a smoother shading rate transition across the image LMS uses 4 viewports per eye, while MRS uses 9. This makes LMS easier to work along with Instanced Stereo and Single Pass Stereo Fewer viewports also benefits performance
55
Desired (inverse lens warp) Default (planar projection) MRS (Quality) LMS (Quality) (screen) x shading rate 1.0 1.04 1.35
56
Baseline (no warp) 2.54 MPix / eye
MRS LMS
Conservative
(no worse than baseline)
Aggressive
(3/4 Reso. of conservative)
1.57 MPix / eye 1.17 MPix / eye 0.87 MPix / eye 2.03 MPix / eye 1.58 MPix / eye 1.40 MPix / eye Quality
(no undersampling)
LMS vs. MRS
57
1.57 1.17 0.87 2.03 1.58 1.4 2.54
0.5 1 1.5 2 2.5 3
Baseline Quality Conservative Aggressive
Number of Pixels (Millions)
LMS/MRS Shading Rate Comparison
LMS MRS Baseline
58
59
Linear Space UV LMS Space UV (0, 0) (0, 1) (1, 0) (1, 1) (1, 1) (1, 0) (0, 0) (0, 1) LMS Space Stereo UV (1, 1) (1, 0) (0, 0) (0, 1) (0.5, 0) (0.5, 1) (0.5, 1) (0.5, 0)
Z value changed too!
60
multiple viewports & scissors before draw call submission, for which we have provided helper functions.
View.BeginVRProjectionStates(RHICmdList); // Invoke draw calls.. View.EndVRProjectionStates(RHICmdList);
61
to invoke shading for most screen space passes
to avoid drawing to pixels outside of the valid region
linearly across the view.
(0 ,0) (1, 0) (1, 1) (0, 1)
62
Z pre-pass to avoid rendering to pixels outside of the octagon region
for passes that did not have it bound
63
code produce Z value in linear space
64
correct viewports.
1 4 3 5 8 6 7 2
Left shift 4 bits
65
66
sampling time overhead
67
to linear space before applying offset in linear space. Remap it back to LMS space for sampling
To Linear To LMS Sample Origin in LMS Space Stepped Position in Linear Space Stepped Position Remapped to LMS Space
68
to fetch Gbuffer
with GBuffer data
69
The input SVPos is in LMS space. So convert it to linear space, since CameraVector is used to calculate lighting with GBuffer data, which is also in linear space. InUV is LMS space. When fetching data from GBuffers, use LMS space coordinates directly Since GBuffer is indexed in LMS space.
70
2 4 6 8 10 12 Everest Realistic Rendering Landscape Mountain
Frame time (Miliseconds)
LMS/MRS Performance Benchmark
Regular LMS1 LMS2 LMS3 MRS3
71
MRS LMS LMS MRS
72
73
74
75
cem@nvidia.com edliu@nvidia.com developer.nvidia.com/vr