introduction and techniques with nvidia® gvdb...

45
Dr. Rama Hoetzlein, Lead Architect for GVDB Voxels INTRODUCTION AND TECHNIQUES WITH NVIDIA® GVDB VOXELS

Upload: others

Post on 02-Aug-2020

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: INTRODUCTION AND TECHNIQUES WITH NVIDIA® GVDB …on-demand.gputechconf.com/gtc/2017/presentation/s7424-rama-hoetzlein...DreamWorks Animation. 3 MOTIVATION Motion Pictures Data Property

Dr. Rama Hoetzlein, Lead Architect for GVDB Voxels

INTRODUCTION AND TECHNIQUES WITH NVIDIA® GVDB VOXELS

Page 2: INTRODUCTION AND TECHNIQUES WITH NVIDIA® GVDB …on-demand.gputechconf.com/gtc/2017/presentation/s7424-rama-hoetzlein...DreamWorks Animation. 3 MOTIVATION Motion Pictures Data Property

2

MOTIVATIONMotion Pictures

Data Property of DreamWorks Animation

Page 3: INTRODUCTION AND TECHNIQUES WITH NVIDIA® GVDB …on-demand.gputechconf.com/gtc/2017/presentation/s7424-rama-hoetzlein...DreamWorks Animation. 3 MOTIVATION Motion Pictures Data Property

3

MOTIVATIONMotion Pictures

Data Property of DreamWorks Animation

Page 4: INTRODUCTION AND TECHNIQUES WITH NVIDIA® GVDB …on-demand.gputechconf.com/gtc/2017/presentation/s7424-rama-hoetzlein...DreamWorks Animation. 3 MOTIVATION Motion Pictures Data Property

4

MOTIVATION3D Printing

Page 5: INTRODUCTION AND TECHNIQUES WITH NVIDIA® GVDB …on-demand.gputechconf.com/gtc/2017/presentation/s7424-rama-hoetzlein...DreamWorks Animation. 3 MOTIVATION Motion Pictures Data Property

5

MOTIVATION3D Printing

Page 6: INTRODUCTION AND TECHNIQUES WITH NVIDIA® GVDB …on-demand.gputechconf.com/gtc/2017/presentation/s7424-rama-hoetzlein...DreamWorks Animation. 3 MOTIVATION Motion Pictures Data Property

6A Numerical Study of High-Pressure Oxygen/Methane Mixing and

Combustion of a Shear Coaxial Injector, Nan Zong & Vigor Yang, AIAA 2005

MOTIVATIONScientific Visualization

Page 7: INTRODUCTION AND TECHNIQUES WITH NVIDIA® GVDB …on-demand.gputechconf.com/gtc/2017/presentation/s7424-rama-hoetzlein...DreamWorks Animation. 3 MOTIVATION Motion Pictures Data Property

7

MOTIVATIONScientific Visualization

Page 8: INTRODUCTION AND TECHNIQUES WITH NVIDIA® GVDB …on-demand.gputechconf.com/gtc/2017/presentation/s7424-rama-hoetzlein...DreamWorks Animation. 3 MOTIVATION Motion Pictures Data Property

8

INTRODUCING

NVIDIA® GVDB VOXELS

A new, open source NVIDIA SDK for compute, simulation and rendering

of sparse volumes based on CUDA

Page 9: INTRODUCTION AND TECHNIQUES WITH NVIDIA® GVDB …on-demand.gputechconf.com/gtc/2017/presentation/s7424-rama-hoetzlein...DreamWorks Animation. 3 MOTIVATION Motion Pictures Data Property

9

OUTLINE

1. Overview

2. GVDB Features

3. Workflow

4. Compute API: Spray Deposition

5. Rendering API: OptiX Integration

6. Dynamic API: Fluid Surface

Page 10: INTRODUCTION AND TECHNIQUES WITH NVIDIA® GVDB …on-demand.gputechconf.com/gtc/2017/presentation/s7424-rama-hoetzlein...DreamWorks Animation. 3 MOTIVATION Motion Pictures Data Property

10NVIDIA CONFIDENTIAL. DO NOT DISTRIBUTE.

NVIDIA® GVDB VOXELSOverview

What is GVDB Voxels?

- An SDK library for developers to create applications

in Motion Pictures, 3D Printing and Scientific Sim/Vis

- Abstracts the complexity of sparseness to support

compute and rendering of high resolution volumes

- Based on CUDA, for portability to embedded

devices (JetsonTX), Quadro/GeForce, Tegra/GRID

- Open source, fBor developers to customize

Page 11: INTRODUCTION AND TECHNIQUES WITH NVIDIA® GVDB …on-demand.gputechconf.com/gtc/2017/presentation/s7424-rama-hoetzlein...DreamWorks Animation. 3 MOTIVATION Motion Pictures Data Property

11NVIDIA CONFIDENTIAL. DO NOT DISTRIBUTE.

NVIDIA® GVDB VOXELSOverview

DenseVolume

Page 12: INTRODUCTION AND TECHNIQUES WITH NVIDIA® GVDB …on-demand.gputechconf.com/gtc/2017/presentation/s7424-rama-hoetzlein...DreamWorks Animation. 3 MOTIVATION Motion Pictures Data Property

12NVIDIA CONFIDENTIAL. DO NOT DISTRIBUTE.

NVIDIA® GVDB VOXELSOverview

DenseVolume

8 empty steps

5 sample steps

Page 13: INTRODUCTION AND TECHNIQUES WITH NVIDIA® GVDB …on-demand.gputechconf.com/gtc/2017/presentation/s7424-rama-hoetzlein...DreamWorks Animation. 3 MOTIVATION Motion Pictures Data Property

13NVIDIA CONFIDENTIAL. DO NOT DISTRIBUTE.

NVIDIA® GVDB VOXELSOverview

DenseVolume

8 empty steps

5 sample steps

Page 14: INTRODUCTION AND TECHNIQUES WITH NVIDIA® GVDB …on-demand.gputechconf.com/gtc/2017/presentation/s7424-rama-hoetzlein...DreamWorks Animation. 3 MOTIVATION Motion Pictures Data Property

14NVIDIA CONFIDENTIAL. DO NOT DISTRIBUTE.

NVIDIA® GVDB VOXELSOverview

SparseVolume

2 DDA skip steps

5 sample steps

52 data values

(instead of 256!)

Page 15: INTRODUCTION AND TECHNIQUES WITH NVIDIA® GVDB …on-demand.gputechconf.com/gtc/2017/presentation/s7424-rama-hoetzlein...DreamWorks Animation. 3 MOTIVATION Motion Pictures Data Property

15NVIDIA CONFIDENTIAL. DO NOT DISTRIBUTE.

NVIDIA® GVDB VOXELSOverview

SparseVolume

2 DDA skip steps

5 sample steps

52 data values

(instead of 256!)

Page 16: INTRODUCTION AND TECHNIQUES WITH NVIDIA® GVDB …on-demand.gputechconf.com/gtc/2017/presentation/s7424-rama-hoetzlein...DreamWorks Animation. 3 MOTIVATION Motion Pictures Data Property

16NVIDIA CONFIDENTIAL. DO NOT DISTRIBUTE.

NVIDIA® GVDB VOXELSOverview

52 data values

(instead of 256!)

Topology

Data Atlas

Page 17: INTRODUCTION AND TECHNIQUES WITH NVIDIA® GVDB …on-demand.gputechconf.com/gtc/2017/presentation/s7424-rama-hoetzlein...DreamWorks Animation. 3 MOTIVATION Motion Pictures Data Property

17

OPENVDB

Ken Museth, Dreamworks AnimationVDB: High-Resolution Sparse Volumes with Dynamic Topology. Transactions on Graphics, 2013

www.openvdb.org

Page 18: INTRODUCTION AND TECHNIQUES WITH NVIDIA® GVDB …on-demand.gputechconf.com/gtc/2017/presentation/s7424-rama-hoetzlein...DreamWorks Animation. 3 MOTIVATION Motion Pictures Data Property

18NVIDIA CONFIDENTIAL. DO NOT DISTRIBUTE.

NVIDIA® GVDB VOXELSOverview

52 data values

(instead of 256!)

CPU GPU

~10 MB

Topology Voxel Data

>1 GB

Page 19: INTRODUCTION AND TECHNIQUES WITH NVIDIA® GVDB …on-demand.gputechconf.com/gtc/2017/presentation/s7424-rama-hoetzlein...DreamWorks Animation. 3 MOTIVATION Motion Pictures Data Property

19NVIDIA CONFIDENTIAL. DO NOT DISTRIBUTE.

NVIDIA® GVDB VOXELSOverview

52 data values

(instead of 256!)

Hoetzlein, GVDB: Raytracing Sparse Voxel Database Structures on the GPUHigh Performance Graphics, 2017

- Memory pooling for fast topology

- 3D Textures for hardware trilinear filtering

- Indexing instead of pointers for CPU-GPU transfers

Page 20: INTRODUCTION AND TECHNIQUES WITH NVIDIA® GVDB …on-demand.gputechconf.com/gtc/2017/presentation/s7424-rama-hoetzlein...DreamWorks Animation. 3 MOTIVATION Motion Pictures Data Property

20NVIDIA CONFIDENTIAL. DO NOT DISTRIBUTE.

NVIDIA® GVDB VOXELS

Featuresfor Developers 52 data values

(instead of 256!)

Compute API Author compute kernels more easily

with virtual neighbors.

Render API Built-in and custom rendering

for CUDA and OptiX Raytracing

Dynamic API Modify topology to support

dynamic simulations

See Programming Guide for additional APIs and features

Page 21: INTRODUCTION AND TECHNIQUES WITH NVIDIA® GVDB …on-demand.gputechconf.com/gtc/2017/presentation/s7424-rama-hoetzlein...DreamWorks Animation. 3 MOTIVATION Motion Pictures Data Property

21

COMPUTE /SIMULATION

FluidSurfaceSample

SprayDeposit Sample

Page 22: INTRODUCTION AND TECHNIQUES WITH NVIDIA® GVDB …on-demand.gputechconf.com/gtc/2017/presentation/s7424-rama-hoetzlein...DreamWorks Animation. 3 MOTIVATION Motion Pictures Data Property

22

AGENDAVolume Smoothing

Launch GPU kernels over all sparse voxels.

Efficient compute on very large domains.

COMPUTE API

Page 23: INTRODUCTION AND TECHNIQUES WITH NVIDIA® GVDB …on-demand.gputechconf.com/gtc/2017/presentation/s7424-rama-hoetzlein...DreamWorks Animation. 3 MOTIVATION Motion Pictures Data Property

23

extern "C" __global__ void kernelSmooth ( int res, float amt ){

GVDB_SHARED_COPY Macro ensures neighbors are available in shared memory

float v = 6.0*svox[ndx.x][ndx.y][ndx.z]; Smoothing operationv += svox[ndx.x-1][ndx.y][ndx.z]; ( values from neighbors)v += svox[ndx.x+1][ndx.y][ndx.z];v += svox[ndx.x][ndx.y-1][ndx.z];v += svox[ndx.x][ndx.y+1][ndx.z];v += svox[ndx.x][ndx.y][ndx.z-1];v += svox[ndx.x][ndx.y][ndx.z+1];v /= 12.0;

surf3Dwrite ( v, volTexOut, vox.x*sizeof(float), vox.y, vox.z ); Output value}

Volume Smoothing

COMPUTE API

Page 24: INTRODUCTION AND TECHNIQUES WITH NVIDIA® GVDB …on-demand.gputechconf.com/gtc/2017/presentation/s7424-rama-hoetzlein...DreamWorks Animation. 3 MOTIVATION Motion Pictures Data Property

24

Simulation

COMPUTE API

Page 25: INTRODUCTION AND TECHNIQUES WITH NVIDIA® GVDB …on-demand.gputechconf.com/gtc/2017/presentation/s7424-rama-hoetzlein...DreamWorks Animation. 3 MOTIVATION Motion Pictures Data Property

25

Simulation

COMPUTE API

Generate Raysfrom Source

Cast Raysinto Scene

Accumulate material atHit points

Smooth tosimulate viscosity

repeat

Page 26: INTRODUCTION AND TECHNIQUES WITH NVIDIA® GVDB …on-demand.gputechconf.com/gtc/2017/presentation/s7424-rama-hoetzlein...DreamWorks Animation. 3 MOTIVATION Motion Pictures Data Property

26

Simulation

COMPUTE API

Generate Raysfrom Source

Cast Raysinto Scene

Accumulate material atHit points

Smooth tosimulate viscosity

Application

GVDB VOXELS

Model Part

SparseRaytracing

VoxelSmoothing

AddDensity

Page 27: INTRODUCTION AND TECHNIQUES WITH NVIDIA® GVDB …on-demand.gputechconf.com/gtc/2017/presentation/s7424-rama-hoetzlein...DreamWorks Animation. 3 MOTIVATION Motion Pictures Data Property

27

Simulation

COMPUTE API

void App::simulate (){

numrays = 1000;gvdb.AllocData ( rays, numrays, sizeof(ScnRay) );

ScnRay* ray = (ScnRay*) gvdb.getDataPtr ( 0, rays );for (int n=0; n < numrays; n++ ) {

GenerateRay ( ray );ray++;

}gvdb.CommitData ( rays );

gvdb.Raytrace ( rays, SHADE_TRILINEAR, 0, -0.0001 );

gvdb.SetPoints ( pntpos, pntclr );gvdb.InsertPoints ( rays, Vector3DF(0,0,0) );

gvdb.ScatterPointDensity ( rays, 2.0, 1.0, Vector3DF(0,0,0) );gvdb.UpdateApron ();

gvdb.Compute ( FUNC_SMOOTH, 0, 1, Vector3DF(4,0,0), true );}

Allocate ray memory (CPU and GPU)

Generate rays

Commit rays to GPU

Raytracing to hit part

Scatter new material at hit points

Smooth result slightly

Page 28: INTRODUCTION AND TECHNIQUES WITH NVIDIA® GVDB …on-demand.gputechconf.com/gtc/2017/presentation/s7424-rama-hoetzlein...DreamWorks Animation. 3 MOTIVATION Motion Pictures Data Property

28

RENDERING

InteractiveGLSample

InteractiveOptiX Sample

Page 29: INTRODUCTION AND TECHNIQUES WITH NVIDIA® GVDB …on-demand.gputechconf.com/gtc/2017/presentation/s7424-rama-hoetzlein...DreamWorks Animation. 3 MOTIVATION Motion Pictures Data Property

29

Native Rendering

RENDER API

// Render with CUDAgvdb.Render ( 0, SHADE_TRILINEAR, .. )

// Read result into OpenGL texturegvdb.ReadRenderTexGL ( 0, gl_texture );

// Display texture on screenrenderScreenQuadGL ( gl_texture );

3DPrint Sample

Page 30: INTRODUCTION AND TECHNIQUES WITH NVIDIA® GVDB …on-demand.gputechconf.com/gtc/2017/presentation/s7424-rama-hoetzlein...DreamWorks Animation. 3 MOTIVATION Motion Pictures Data Property

30

Native Rendering

RENDER API

// Set render parameters

SetExtinct ( -1.0f, 1.5f, 0.0f );

SetVolumeRange ( 0.1f, 0.0f, .1f );

SetCutoff ( 0.005f, 0.01f, 0.0f );

SetBackgroundClr ( 0.1, 0.2, 0.4, 1.0 );

// Create transfer function

LinearTransferFunc ( 0.00f, 0.25f, … );

LinearTransferFunc ( 0.25f, 0.50f, … );

LinearTransferFunc ( 0.50f, 0.75f, … );

LinearTransferFunc ( 0.75f, 1.00f, … );

// Render with CUDA

gvdb.Render ( 0, SHADE_VOLUME, .. )

InteractiveGL Sample

Page 31: INTRODUCTION AND TECHNIQUES WITH NVIDIA® GVDB …on-demand.gputechconf.com/gtc/2017/presentation/s7424-rama-hoetzlein...DreamWorks Animation. 3 MOTIVATION Motion Pictures Data Property

31

OptiX: A General Purpose Ray Tracing Engine, Steven Parker. ACM Transactions on Graphics, Vol. 29, No. 4, July 2010

Page 32: INTRODUCTION AND TECHNIQUES WITH NVIDIA® GVDB …on-demand.gputechconf.com/gtc/2017/presentation/s7424-rama-hoetzlein...DreamWorks Animation. 3 MOTIVATION Motion Pictures Data Property

32

Page 33: INTRODUCTION AND TECHNIQUES WITH NVIDIA® GVDB …on-demand.gputechconf.com/gtc/2017/presentation/s7424-rama-hoetzlein...DreamWorks Animation. 3 MOTIVATION Motion Pictures Data Property

33

GVDB and OptiX

RENDER API

InteractiveOptiX Sample

Page 34: INTRODUCTION AND TECHNIQUES WITH NVIDIA® GVDB …on-demand.gputechconf.com/gtc/2017/presentation/s7424-rama-hoetzlein...DreamWorks Animation. 3 MOTIVATION Motion Pictures Data Property

34

Voxel-to-PolygonScattering

Polygon-to-PolygonScattering

PolygonSelf-Shadowing

VolumeDeep Rendering

InteractiveOptiX Sample

GVDB and OptiX

RENDER API

Page 35: INTRODUCTION AND TECHNIQUES WITH NVIDIA® GVDB …on-demand.gputechconf.com/gtc/2017/presentation/s7424-rama-hoetzlein...DreamWorks Animation. 3 MOTIVATION Motion Pictures Data Property

35

GVDB and OptiX

RENDER API

Page 36: INTRODUCTION AND TECHNIQUES WITH NVIDIA® GVDB …on-demand.gputechconf.com/gtc/2017/presentation/s7424-rama-hoetzlein...DreamWorks Animation. 3 MOTIVATION Motion Pictures Data Property

36

GVDB and OptiX

RENDER API

Thursday, 2:00-2:25pm, S7425

3D PRINTING WITH NVIDIA GVDB VOXELS

Page 37: INTRODUCTION AND TECHNIQUES WITH NVIDIA® GVDB …on-demand.gputechconf.com/gtc/2017/presentation/s7424-rama-hoetzlein...DreamWorks Animation. 3 MOTIVATION Motion Pictures Data Property

37

Features

RENDER API

- Efficient raytracing of large,

sparse volumes

- CUDA based raytracing

- Native rendering of semi-transparent

volumes, isosurfaces and level sets

- Integration with NVIDIA® OptiX

- Custom transfer functions and

custom render kernels

- Rendering API in GVDB Library

Page 38: INTRODUCTION AND TECHNIQUES WITH NVIDIA® GVDB …on-demand.gputechconf.com/gtc/2017/presentation/s7424-rama-hoetzlein...DreamWorks Animation. 3 MOTIVATION Motion Pictures Data Property

38

VIDEO

Page 39: INTRODUCTION AND TECHNIQUES WITH NVIDIA® GVDB …on-demand.gputechconf.com/gtc/2017/presentation/s7424-rama-hoetzlein...DreamWorks Animation. 3 MOTIVATION Motion Pictures Data Property

39

PLATFORMS

Jetson TX1 / TX2

Page 40: INTRODUCTION AND TECHNIQUES WITH NVIDIA® GVDB …on-demand.gputechconf.com/gtc/2017/presentation/s7424-rama-hoetzlein...DreamWorks Animation. 3 MOTIVATION Motion Pictures Data Property

40

PLATFORMS

Time (sec)

Lower is better

Voxelization

VoronoiGeneration

Rendering(30 frames)

Pascal GP100Maxwell

PASCAL GP100GVDB Performance

+42% faster

+65% faster

+100% faster

6.3 sec

3.1 sec

2.5 sec

1.5 sec

45 msec/frame

31

Page 41: INTRODUCTION AND TECHNIQUES WITH NVIDIA® GVDB …on-demand.gputechconf.com/gtc/2017/presentation/s7424-rama-hoetzlein...DreamWorks Animation. 3 MOTIVATION Motion Pictures Data Property

41

Platforms

NVIDIA® GVDB VOXELS

Hardware: Jetson TX1 / TX2 embedded systems

Quadro, GeForce

Tesla K80 computing cluster

Software: CUDA Compute 3.0 and higher

CUDA Toolkit 6.5 and higher

Operating Windows 7/8/10 64-bit and Linux

Systems:

Licensing: Open Source, BSD 3-clause

256 cores (Tegra)3840 cores (GP100)4992 cores (K80)

Page 42: INTRODUCTION AND TECHNIQUES WITH NVIDIA® GVDB …on-demand.gputechconf.com/gtc/2017/presentation/s7424-rama-hoetzlein...DreamWorks Animation. 3 MOTIVATION Motion Pictures Data Property

42

VOX3: Experimental DIY DLP/SLA 3D Printer

Thursday, 2:00-2:25pm, S7425

3D PRINTING WITH NVIDIA GVDB VOXELS

Page 43: INTRODUCTION AND TECHNIQUES WITH NVIDIA® GVDB …on-demand.gputechconf.com/gtc/2017/presentation/s7424-rama-hoetzlein...DreamWorks Animation. 3 MOTIVATION Motion Pictures Data Property

43

Software

NVIDIA® GVDB VOXELS

http://developer.nvidia.com/gvdb

Download from website

Windows Installer or Github

Comes with 8x samples

Detailed Programming Guide on webpage

New Forum on devtalk.nvidia.com

Page 44: INTRODUCTION AND TECHNIQUES WITH NVIDIA® GVDB …on-demand.gputechconf.com/gtc/2017/presentation/s7424-rama-hoetzlein...DreamWorks Animation. 3 MOTIVATION Motion Pictures Data Property

44

NVIDIA® GVDB VOXELS

Rama Hoetzlein Lead Architect for GVDB Voxels

Thanks to..

Andrew Page Product ManagerPrerna Dogra Product Manager, 3D PrintingVincent Brisebois MarketingTristan Lorach Professional Graphics

[email protected]

Page 45: INTRODUCTION AND TECHNIQUES WITH NVIDIA® GVDB …on-demand.gputechconf.com/gtc/2017/presentation/s7424-rama-hoetzlein...DreamWorks Animation. 3 MOTIVATION Motion Pictures Data Property

THANK YOU