Virtual Reality Features of NVIDIA GPUs

42
Mark Kilgard, July 27, 2016 Virtual Reality Features of NVIDIA GPUs

Transcript of Virtual Reality Features of NVIDIA GPUs

Page 1: Virtual Reality Features of NVIDIA GPUs

Mark Kilgard, July 27, 2016

Virtual Reality Features ofNVIDIA GPUs

Page 2: Virtual Reality Features of NVIDIA GPUs

2

Mark Kilgard

Principal System Software EngineerOpenGL driver implementation & API evolutionOther interests

Programmable shading languages, original Cg GPU shading language

Web, vector graphics & path rendering, GPU rendering for 2D graphics

Also known for creating OpenGL Utility Toolkit (GLUT)

My Background

Page 3: Virtual Reality Features of NVIDIA GPUs

3

GPU Challenges for Virtual Reality Rendering

1. Must render unique view for each eyeTwo scene renders per frame

2. Wide field-of-view renderedMore pixels, distributed towards periphery

3. HMD lens magnifies rendered sceneNon-linear inverse lens warp

Allows the HMD lens magnification to provide convincing sense of presence

Page 4: Virtual Reality Features of NVIDIA GPUs

4

Magnification Effect of HMD Lens

Graph paper viewed & magnified through HMD lens

Page 5: Virtual Reality Features of NVIDIA GPUs

5

Head Mounted Display Lens Effect

Barrel Distorted Imageson HMD Screen

Magnified Overlapping Wide Field-of-viewBinocular View

Page 6: Virtual Reality Features of NVIDIA GPUs

6

Focus on Virtual Reality Features of Pascal GPUs

Virtual Reality rendering features in Pascal GPUsGeForce 1080/1070/1060 NEW Quadro P6000 & P5000

As exposed in standard 3D APIs

Page 7: Virtual Reality Features of NVIDIA GPUs

7

Background: NVIDA GPU Architecture Road Map

Our interest NVIDIA GPU architectures of interest: Pascal

What is Pascal mentioned on last slide?

Page 8: Virtual Reality Features of NVIDIA GPUs

8

Conventional 3D Single-eye Scene

Page 9: Virtual Reality Features of NVIDIA GPUs

9

Conventional 3D Single-eye Scene

Page 10: Virtual Reality Features of NVIDIA GPUs

10

Wide Stereo Views of Same Scene

Left Right

Page 11: Virtual Reality Features of NVIDIA GPUs

11 Left Right

Page 12: Virtual Reality Features of NVIDIA GPUs

12 Right Left

Page 13: Virtual Reality Features of NVIDIA GPUs

13

Left & Right Views AreSimilar but Different

Left and Right eye views have different occlusionWhile left & right eye views look similar, must be draw independently

Really only different in a small translation in X

NVIDIA Single Pass Stereo supports generating left & right eye positionsGPU automatically makes left & right eye versions of each primitiveThen renders each view to a different framebuffer sliceExposed in OpenGL by NV_stereo_view_rendering extensionExposed for Direct3D 11 by NVAPI SinglePassStereoMode feature

Page 14: Virtual Reality Features of NVIDIA GPUs

14

Image Difference of Two Views

− + 0.5 =

Left eye view Right eye viewClamped difference image

Page 15: Virtual Reality Features of NVIDIA GPUs

15

Left & Right Views Rendered Efficiently in One Pass

Page 16: Virtual Reality Features of NVIDIA GPUs

16

Lens Matched Shading

Left Right

Page 17: Virtual Reality Features of NVIDIA GPUs

17

Visualizing Lens Matched Shading

Page 18: Virtual Reality Features of NVIDIA GPUs

18

Lens Matched Shading

Left Right

Page 19: Virtual Reality Features of NVIDIA GPUs

19

Visualization of Lens Matched Shading Rendering

Page 20: Virtual Reality Features of NVIDIA GPUs

20

Still Needs Non-linear Warp

Lens Matched Shadingrendering

Warped image suitablefor HMD display

Non-linearimage

Page 21: Virtual Reality Features of NVIDIA GPUs

21

Still Needs Non-linear Warp

Lens Matched Shadingrendering

Warped image suitablefor HMD display

Non-linearimage

BUT substantiallyless pixel motion

and distortionthan conventional

VR re-warping

Page 22: Virtual Reality Features of NVIDIA GPUs

22

Example HMD Post-rendering Warp

Page 23: Virtual Reality Features of NVIDIA GPUs

23

Lens Matched Shadingwith Window Rectangle Testing

Page 24: Virtual Reality Features of NVIDIA GPUs

24

Lens Matched Shadingwith Window Rectangle Testing

Nothing in black corners is shaded or even rasterizedYellow lines show overlaid 8 inclusive window rectanglesSame 8 window rectangles “shared” by each view’s texture array layer

Page 25: Virtual Reality Features of NVIDIA GPUs

25

Lens Matched Shadingwith Window Rectangle Testing

Page 26: Virtual Reality Features of NVIDIA GPUs

26

What Didn’t Have to be Rendered

17% of left view pixels 17% of right view pixels

Page 27: Virtual Reality Features of NVIDIA GPUs

27

Window Rectangle TestingDuring Rasterization

New multi-vendor OpenGL extension

EXT_window_rectangles

Provides a set of window-space rectangles, 8 for NVIDIA GPUs

Rasterizer either includes or excludes rasterization from rectangles

Discards at speed-of-lightAs if free to rasterize to irregular rectangular regions

WindowRectangles

Test

NEWstage

OpenGL’s fragment processing pipeline

Page 28: Virtual Reality Features of NVIDIA GPUs

28

Warped Lens Matched Scene

Warped version of Lens Matched Shading to match HMD lens

Page 29: Virtual Reality Features of NVIDIA GPUs

29

Warped Lens Matched Shading

Page 30: Virtual Reality Features of NVIDIA GPUs

30

Visualizing Warp Window Rectangles

Page 31: Virtual Reality Features of NVIDIA GPUs

31

What Didn’t Have to be Warped

17% of left view pixels 17% of right view pixels

Page 32: Virtual Reality Features of NVIDIA GPUs

32

VR Rendering Pipeline in Images

LMS Right Eye View Warped Right Eye View

LMS Left Eye View Warped Left Eye View

Scene

LMS = Lens Matched Shading

Page 33: Virtual Reality Features of NVIDIA GPUs

33

VR Rendering Pipeline in Images

LMS Right Eye View Warped Right Eye View

LMS Left Eye View Warped Left Eye View

Scene

Displayed within HMD

Single Rendering PassSingle Pass Stereo +

Lens Matched Shading +Window Rectangle Testing

Drawn with Single TriangleFragment Shader WarpingWindow Rectangle Testing

Perception to user is linear rendering HMD lens “undoes” warping to provide

a perceived wide field-of-view

Pascal does all thisefficiently in a singlerendering pass!

8 viewports, 1 pass

Page 34: Virtual Reality Features of NVIDIA GPUs

34

Traditional 3D Rendering Pipeline

Transform3D View Downsample Display

FrameApp

Processing

if multisampled

uses pinhole camera projection,rasterizing to uniform rectilinear pixel grid

monitor directlydisplays uniform rectilinear pixel grid

Rasterize3D View

Page 35: Virtual Reality Features of NVIDIA GPUs

35

Virtual Reality Rendering PipelineRendering Left & Right Eye Views

TransformLeft View Downsample

DisplayFrame to HMD

AppProcessing

RasterizeLeft View

TransformRight View DownsampleRasterize

Right View

HMDWarp

HMDWarp

warps uniform rectilinear grid based on HMD’s device profile

TransformRight View

RasterizeRight View

TransformRight View DownsampleRasterize

Right ViewTransformRight View

HMDWarpDownsampleRasterize

Right ViewTransformRight View

second view rendering

Page 36: Virtual Reality Features of NVIDIA GPUs

36

Virtual Reality Rendering PipelineWith Lens Matched Shading

TransformLeft View Downsample

DisplayFrame to HMD

AppProcessing

RasterizeLeft View

TransformRight View DownsampleRasterize

Right View

HMDWarp

HMDWarp

LensMatchedShading

LensMatchedShading

replicates primitiveto 4 projected quadrants

less pixel resamplingeffort & error operating onLMS rasterized images

Page 37: Virtual Reality Features of NVIDIA GPUs

37

Virtual Reality Rendering PipelineWith Single Pass Stereo

TransformLeft & Right

View

Downsample

DisplayFrame to HMD

AppProcessing

RasterizeLeft View

DownsampleRasterizeRight View

HMDWarp

HMDWarp

one transform instance,outputs left & right position

Page 38: Virtual Reality Features of NVIDIA GPUs

38

Virtual Reality Rendering PipelineSingle Pass Stereo + Lens Matched Shading

Downsample

DisplayFrame to HMD

RasterizeLeft View

DownsampleRasterizeRight View

HMDWarp

HMDWarp

LensMatchedShading

LensMatchedShading

TransformLeft & Right

View

AppProcessing

+ Advantages1. Single transform for both views2. Closer match between rendering & lens images3. Fewer overall pixels for similar quality

use window rectangle testingto bound lens region, duringboth rasterization & warp

Page 39: Virtual Reality Features of NVIDIA GPUs

39

Pascal GPU Features for VRUnique to NVIDIA

Pascal renders left & right eyeIn single rendering pass

Halves CPU load for rendering

Better concurrent texture locality

OpenGL: NV_stereo_view_renderingDirect3D: NVAPI SinglePassStereoMode

Better matches rendering to HMD lensSingle pass

Four separately projected quadrants

Less rendering, less resampling error

OpenGL: NV_clip_space_w_scalingDirect3D: NVAPI ModifiedWSupport

Page 40: Virtual Reality Features of NVIDIA GPUs

40

Other NVIDIA Virtual Reality Initiatives

Page 41: Virtual Reality Features of NVIDIA GPUs

41

More Information

VRWORKS 2.0 Software Development KitAvailable NOW

Pascal OpenGL extensions for Virtual RealitySpecification now public

In official OpenGL.org extension registry

OpenGL Extension Wrangler 2.0 (GLEW) support

Example code in VRWORKS 2.0 SDK

VRWORKS also documents NVAPI usageFor Direct3D 11

Includes Examples code

Page 42: Virtual Reality Features of NVIDIA GPUs