INTRODUCTION TO OPTIX Martin Stich, Engineering Manager OptiX - - PowerPoint PPT Presentation

introduction to optix
SMART_READER_LITE
LIVE PREVIEW

INTRODUCTION TO OPTIX Martin Stich, Engineering Manager OptiX - - PowerPoint PPT Presentation

INTRODUCTION TO OPTIX Martin Stich, Engineering Manager OptiX Basics Advanced Topics AGENDA Case Studies Feature Outlook 2 OPTIX BASICS 3 IN A NUTSHELL The OptiX Ray Tracing SDK State-of-the-art performance: 500M+ rays/sec Algorithm and


slide-1
SLIDE 1

Martin Stich, Engineering Manager

INTRODUCTION TO OPTIX

slide-2
SLIDE 2

2

AGENDA

OptiX Basics Advanced Topics Case Studies Feature Outlook

slide-3
SLIDE 3

3

OPTIX BASICS

slide-4
SLIDE 4

4

IN A NUTSHELL

State-of-the-art performance: 500M+ rays/sec Algorithm and hardware agnostic Shaders with single-ray programming model, recursion Available free for private and commercial use

The OptiX Ray Tracing SDK

slide-5
SLIDE 5

5

RELEASE TIMELINE

Jan 2016 Summer 2016 TODAY!

OptiX 3.9

Pascal Support

OptiX 4.0

LLVM Pipeline NVLINK Scaling

OptiX 4.1

Performance CUDA 8, VS2015

2009

OptiX 1.0

Hello World!

...

slide-6
SLIDE 6

6

MODERN RAY TRACING

Rasterization:

slide-7
SLIDE 7

7

MODERN RAY TRACING

Rasterization: Ray Tracing:

slide-8
SLIDE 8

8

THE RAY TRACING PIPELINE

Programmable: Ray Generation Closest Hit, Any Hit, Miss Intersection ← Launch entry ← Shading ← Geometry

RAY GENERATION INTERSECTION ANY-HIT INTERSECTION ANY-HIT CLOSEST-HIT

slide-9
SLIDE 9

9

MAIN OPERATIONS

RAY GEN INTERSECT ANY HIT CLOSEST HIT MISS rtTrace

✔ ✔ ✔

rtPotentialIntersection

rtReportIntersection

rtIgnoreIntersection

rtTerminateRay

slide-10
SLIDE 10

10

SHADER COMMUNICATION

Variables

similar to uniforms in other systems constants, system values, buffers, textures, … Example: Textures Current ray

slide-11
SLIDE 11

11

SHADER COMMUNICATION

Variables

similar to uniforms in other systems constants, system values, buffers, textures, …

Ray Payload

arbitrary data associated with ray in/out from rtTrace to Any-hit, Closest-hit, Miss Example: Textures Current ray Example: Color data

slide-12
SLIDE 12

12

SHADER COMMUNICATION

Variables

similar to uniforms in other systems constants, system values, buffers, textures, …

Ray Payload

arbitrary data associated with ray in/out from rtTrace to Any-hit, Closest-hit, Miss

Attributes

arbitrary data associated with hit generated in Intersection program consumed by Any-hit, Closest-hit Example: Color data Example: Barycentrics Example: Textures Current ray

slide-13
SLIDE 13

13

EXAMPLE

See optixPathTracer SDK sample for a slightly less minimalistic version

Miniature Path Tracer

slide-14
SLIDE 14

14

GLOBAL ILLUMINATION

slide-15
SLIDE 15

15

GLOBAL ILLUMINATION

slide-16
SLIDE 16

16

GLOBAL ILLUMINATION

slide-17
SLIDE 17

17

GLOBAL ILLUMINATION

slide-18
SLIDE 18

18

HOWEVER…

slide-19
SLIDE 19

19

RAY PAYLOAD

struct RayPayload { float3 radiance; // stores contribution after we hit the light source float3 attenuation; // accumulated attenuation of radiance due to materials float3 next_origin; // reflection ray to be traced for the next float3 next_direction; // ..segment of the path unsigned seed; // random number generator state bool done; // whether we’re done tracing this path };

Path State Definition

slide-20
SLIDE 20

20

INTEGRATION

RT_PROGRAM void ray_generation() { unsigned int seed = tea<16>( launch_index.x + launch_index.y*output_buffer.size().x, frame_number ); float3 ray_origin = eye; float3 ray_direction = compute_jittered_ray_dir( seed ); RayPayload payload; payload.radiance = make_float3(0,0,0); payload.attenuation = make_float3(1,1,1); payload.seed = seed; payload.done = false; int depth = 0; while( !payload.done && depth++ < 10 ) { Ray ray = make_Ray( ray_origin, ray_direction, 0, 0.001f, RT_DEFAULT_MAX ); rtTrace( scene, ray, payload ); ray_origin = payload.next_origin; ray_direction = payload.next_direction; } const float3 result = payload.radiance * payload.attenuation; const float lerp_t = frame_number > 1 ? 1.0f / frame_number : 1.0f; const float3 prev_col = make_float3( output_buffer[launch_index] );

  • utput_buffer[launch_index] = make_float4( lerp( prev_col, result, lerp_t ), 1.0f );

}

1 2 3 4

slide-21
SLIDE 21

21

rtDeclareVariable( float3, diffuse_color, , ); rtDeclareVariable( float3, normal, attribute normal, ); rtDeclareVariable( optix::Ray, ray, rtCurrentRay, ); rtDeclareVariable( float, t_hit, rtIntersectionDistance, ); rtDeclareVariable( RayPayload, current_payload, rtPayload, ); RT_PROGRAM void closest_hit_diffuse() { const float3 hitpoint = ray.origin + t_hit * ray.direction; const float z1 = rnd( current_payload.seed ); const float z2 = rnd( current_payload.seed ); float3 dir; cosine_sample_hemisphere( z1, z2, dir );

  • ptix::Onb onb( normal );
  • nb.inverse_transform( dir );

current_payload.next_origin = hitpoint; current_payload.next_direction = dir; current_payload.attenuation *= diffuse_color; }

DIFFUSE MATERIAL

slide-22
SLIDE 22

22

rtDeclareVariable( RayPayload, current_payload, rtPayload, ); rtDeclareVariable( float3, emission_color, , ); RT_PROGRAM void closest_hit_light() { current_payload.radiance = emission_color; current_payload.done = true; } RT_PROGRAM void miss() { current_payload.radiance = make_float3(0,0,0); current_payload.done = true; }

LIGHT MATERIAL AND MISS

slide-23
SLIDE 23

23

rtDeclareVariable( float3, anchor, , ); rtDeclareVariable( float3, v1, , ); rtDeclareVariable( float3, v2, , ); rtDeclareVariable( float4, plane, , ); rtDeclareVariable( float3, normal, attribute normal, ); rtDeclareVariable( optix::Ray, ray, rtCurrentRay, ); RT_PROGRAM void intersect( int primIdx ) { const float3 n = make_float3( plane ); const float dt = dot( ray.direction, n ); const float t = (plane.w - dot(n, ray.origin)) / dt; const float3 p = ray.origin + ray.direction * t; const float3 vi = p - anchor; const float a1 = dot( v1, vi ); const float a2 = dot( v2, vi ); if( a1 >= 0 && a1 <= 1 && a2 >= 0 && a2 <= 1 ) { if( rtPotentialIntersection( t ) ) { normal = n; rtReportIntersection( 0 ); } } }

SCENE GEOMETRY

slide-24
SLIDE 24

24

RESULT

Accumulation Over Time

slide-25
SLIDE 25

25

NEXT STEP IDEAS

Next event estimation Russian roulette Sphere primitives Mirror material Glass material Triangle meshes Environment maps ...

Mini Path Tracer Reader Exercises

slide-26
SLIDE 26

26

NODE GRAPH

Context Geometry Group Geometry Instance Geometry Material Group

Variables

Intersection Program Any Hit + Closest Hit

slide-27
SLIDE 27

27

ADVANCED TOPICS

slide-28
SLIDE 28

28

INTEROP

Share CUDA and OpenGL Resources

CUDA Share CUDA allocations

rtBufferSetDevicePointer rtBufferGetDevicePointer

OpenGL Share textures and vertex buffers

rtBufferCreateFromGLBO rtTextureSamplerCreateFromGLImage

slide-29
SLIDE 29

29

BINDLESS OBJECTS

“Bindless”: powerful concept to dynamically select textures, buffers, and programs at runtime Allows efficient implementation

  • f large shading networks

Reduces code size, compile times, and number of compiles

Pixar Animation Studio’s “Flow” material editing tool. Visit the NVIDIA website to watch a SIGGRAPH 2015 talk describing the system in detail.

slide-30
SLIDE 30

30

PTX GENERATION

Options

OptiX nvcc.exe nvrtc.dll NVVM/ NVPTX CUDA-C++ CUDA-C++ LLVM-IR PTX Offline JIT

slide-31
SLIDE 31

31

MULTI-GPU AND NVLINK

Automatic Scaling

110M Triangles 23M Grass Blades 15GB Textures 2 x GP100

Monsters University data set courtesy of Pixar Studios

slide-32
SLIDE 32

32

REMOTE RENDERING

On Quadro VCA or DGX-1

Progressive video stream Incremental updates

OptiX App OptiX Server(s)

ETHERNET INTERNET

slide-33
SLIDE 33

33

OPTIX PRIME

Supports instancing, async operations, ray masks Performance similar to OptiX Same semantics via OptiX: See optixRaycasting sample

Simple intersection-only API

Rays Triangles OptiX Prime

GPU or CPU

Intersections

(primIdx, t, u, v)

slide-34
SLIDE 34

34

CASE STUDIES

slide-35
SLIDE 35

35

PERFORMANCE

Raw Traversal on Titan X Pascal

+16% in OptiX 4.1 +3% in OptiX 4.1

slide-36
SLIDE 36

36

NVIDIA: IRAY & MENTAL RAY

slide-37
SLIDE 37

37

NVIDIA: GVDB

Image Property of DreamWorks Animation

OpenVDB format support Live interaction with multiple- bounce GI scattering, 10x-30x faster than CPU Introduction and Techniques with NVIDIA GVDB Voxels Monday, 9:00 AM – Room 231

Sparse Volume Rendering

slide-38
SLIDE 38

38

AAA-STUDIO: FURRYBALL PRODUCTION RENDERING

slide-39
SLIDE 39

39

VISUAL MOLECULAR DYNAMICS (VMD)

Molecular Visualization package with hundreds of thousands of users Developed by John Stone of U Illinois Cutting Edge OptiX Ray Tracing Techniques for Visualization of Biomolecular and Cellular Simulations in VMD Tuesday, 3:30 PM – Room 230C

slide-40
SLIDE 40

40

OLCF: SCIENTIFIC VISUALIZATION

Visualizing laser interaction with metals, hundreds of millions of primitives on DGX-1 Developed by Benjamin Hernandez, OLCF-ORNL Exploratory Visualization of Petascale Particle Data in NVIDIA DGX-1 Tuesday, 3:30 PM – Room 212B

Simulation: OLCF INCITE 2017 "Petascale Simulations of Short Pulse Laser Interaction with Metals" PI Leonid Zhigilei, University of Virginia

slide-41
SLIDE 41

41

NVIDIA: VRWORKS AUDIO

Sound waves reflect

  • ff of the environment

Path traced audio

NVIDIA VRWORKS AUDIO - Improving VR Immersion with acoustic fidelity Thursday, 11:00 AM – Room 230B

slide-42
SLIDE 42

42

BUNGIE: LIGHT BAKING FOR GAMES

Light and occlusion baking is a major bottleneck in game design Workflow-changing speedups by switching from CPU render farms to OptiX

slide-43
SLIDE 43

43

LIGHTMASS

Light baking in Unreal Engine 4 Total Time on Titan X CPU 1638s GPU 1X 426s GPU 2X 298s

slide-44
SLIDE 44

44

ADVANCED SAMPLES

Maintained on Github

A collection of larger, more sophisticated sample applications than the ones that come with the SDK Available at:

https://github.com/ nvpro-samples/optix_advanced_samples

slide-45
SLIDE 45

45

FEATURE OUTLOOK

slide-46
SLIDE 46

46

PERFORMANCE MOTION BLUR SEPARATE COMPILATION

UNDER DEVELOPMENT

Shorter per-shader compile times Fast incremental addition and removal of programs Overall speedup through parallel compilation Performance is always a focus Tackling some big ticket ideas over the next ~year Transform and deformation blur

slide-47
SLIDE 47

47

THANK YOU!

Related Talks:

S7185 - LEVERAGING NVRTC RUNTIME COMPILATION FOR DYNAMICALLY BUILDING OPTIX SHADERS FROM MDL MATERIALS S7454 - NVIDIA ADVANCED RENDERING S7452 - CUTTING EDGE OPTIX RAY TRACING TECHNIQUES FOR VISUALIZATION OF BIOMOLECULAR AND CELLULAR SIMULATIONS IN VMD S7175 - EXPLORATORY VISUALIZATION OF PETASCALE PARTICLE DATA IN NVIDIA DGX-1 S7400 - GPU-CLOUD PHOTOREALISTIC RENDERING FOR THE NEXT GENERATION OF CLOUD CAD TOOLS H7106 - PHYSICALLY BASED RAY TRACING WITH OPTIX S7391 - TURBOCHARGING VMD MOLECULAR VISUALIZATIONS WITH STATE-OF-THE-ART RENDERING AND VR TECHNOLOGIES S7424 - INTRODUCTION AND TECHNIQUES WITH NVIDIA GVDB VOXELS S7135 - NVIDIA VRWORKS AUDIO - IMPROVING VR IMMERSION WITH ACOUSTIC FIDELITY

slide-48
SLIDE 48