Enhancing Traditional Rasterization Graphics with Ray Tracing. March 2015

Similar documents
Enhancing Traditional Rasterization Graphics with Ray Tracing. October 2015

Enabling immersive gaming experiences Intro to Ray Tracing

Practical Techniques for Ray Tracing in Games. Gareth Morgan (Imagination Technologies) Aras Pranckevičius (Unity Technologies) March, 2014

Shadows. COMP 575/770 Spring 2013

INFOGR Computer Graphics. J. Bikker - April-July Lecture 10: Ground Truth. Welcome!

GUERRILLA DEVELOP CONFERENCE JULY 07 BRIGHTON

Interactive Light Mapping with PowerVR Ray Tracing

PowerVR Hardware. Architecture Overview for Developers

Rendering. Converting a 3D scene to a 2D image. Camera. Light. Rendering. View Plane

Ray Tracing. Computer Graphics CMU /15-662, Fall 2016

Applications of Explicit Early-Z Culling

Deferred Rendering Due: Wednesday November 15 at 10pm

Advanced Shading I: Shadow Rasterization Techniques

CMSC427 Advanced shading getting global illumination by local methods. Credit: slides Prof. Zwicker

Sung-Eui Yoon ( 윤성의 )

EECS 487: Interactive Computer Graphics

Introduction to PowerVR Ray Tracing Tuesday 18th March, GDC. James A. McCombe

Getting fancy with texture mapping (Part 2) CS559 Spring Apr 2017

The Traditional Graphics Pipeline

Real-Time Graphics Architecture. Kurt Akeley Pat Hanrahan. Ray Tracing.

The Traditional Graphics Pipeline

Ambient Occlusion. Ambient Occlusion (AO) "shadowing of ambient light "darkening of the ambient shading contribution

Screen Space Ambient Occlusion TSBK03: Advanced Game Programming

Advanced Computer Graphics CS 563: Screen Space GI Techniques: Real Time

TSBK03 Screen-Space Ambient Occlusion

GeForce4. John Montrym Henry Moreton

DEFERRED RENDERING STEFAN MÜLLER ARISONA, ETH ZURICH SMA/

Course Recap + 3D Graphics on Mobile GPUs

GLSL Applications: 2 of 2

Pipeline Operations. CS 4620 Lecture Steve Marschner. Cornell CS4620 Spring 2018 Lecture 11

graphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1

COMP 4801 Final Year Project. Ray Tracing for Computer Graphics. Final Project Report FYP Runjing Liu. Advised by. Dr. L.Y.

Game Technology. Lecture Physically Based Rendering. Dipl-Inform. Robert Konrad Polona Caserman, M.Sc.

graphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1

Real-Time Voxelization for Global Illumination

The Traditional Graphics Pipeline

CS230 : Computer Graphics Lecture 4. Tamar Shinar Computer Science & Engineering UC Riverside

Real-Time Shadows. Last Time? Textures can Alias. Schedule. Questions? Quiz 1: Tuesday October 26 th, in class (1 week from today!

Rasterization Overview

CS354R: Computer Game Technology

FRUSTUM-TRACED RASTER SHADOWS: REVISITING IRREGULAR Z-BUFFERS

Computergrafik. Matthias Zwicker. Herbst 2010

Interactive Volumetric Shadows in Participating Media with Single-Scattering

Metal for Ray Tracing Acceleration

POWERVR MBX. Technology Overview

PowerVR Performance Recommendations. The Golden Rules

The Application Stage. The Game Loop, Resource Management and Renderer Design

Ray tracing. Computer Graphics COMP 770 (236) Spring Instructor: Brandon Lloyd 3/19/07 1

TDA362/DIT223 Computer Graphics EXAM (Same exam for both CTH- and GU students)

Announcements. Written Assignment 2 out (due March 8) Computer Graphics

Hardware-driven visibility culling

3D Rendering Pipeline

Chapter 11 Global Illumination. Part 1 Ray Tracing. Reading: Angel s Interactive Computer Graphics (6 th ed.) Sections 11.1, 11.2, 11.

Dynamic Ambient Occlusion and Indirect Lighting. Michael Bunnell NVIDIA Corporation

Real-Time Rendering (Echtzeitgraphik) Michael Wimmer

Real-Time Shadows. Last Time? Today. Why are Shadows Important? Shadows as a Depth Cue. For Intuition about Scene Lighting

Real-Time Shadows. Last Time? Schedule. Questions? Today. Why are Shadows Important?

Ray Casting on Programmable Graphics Hardware. Martin Kraus PURPL group, Purdue University

Real-Time Shadows. MIT EECS 6.837, Durand and Cutler

Pipeline Operations. CS 4620 Lecture 14

Photorealism: Ray Tracing

FRUSTUM-TRACED RASTER SHADOWS: REVISITING IRREGULAR Z-BUFFERS

Computer Graphics 1. Chapter 7 (June 17th, 2010, 2-4pm): Shading and rendering. LMU München Medieninformatik Andreas Butz Computergraphik 1 SS2010

Radeon ProRender and Radeon Rays in a Gaming Rendering Workflow. Takahiro Harada, AMD 2017/3

Shadows in the graphics pipeline

Real Time Rendering of Complex Height Maps Walking an infinite realistic landscape By: Jeffrey Riaboy Written 9/7/03

Chapter 7 - Light, Materials, Appearance

Shadow Techniques. Sim Dietrich NVIDIA Corporation

Optimizing DirectX Graphics. Richard Huddy European Developer Relations Manager

Real-Time Shadows. Computer Graphics. MIT EECS Durand 1

Hardware Accelerated Volume Visualization. Leonid I. Dimitrov & Milos Sramek GMI Austrian Academy of Sciences

Real-time Ray Tracing on Programmable Graphics Hardware

Ambien Occlusion. Lighting: Ambient Light Sources. Lighting: Ambient Light Sources. Summary

Parallel Triangle Rendering on a Modern GPU

High Quality Adaptive Soft Shadow Mapping

Lecture 9: Deferred Shading. Visual Computing Systems CMU , Fall 2013

Dominic Filion, Senior Engineer Blizzard Entertainment. Rob McNaughton, Lead Technical Artist Blizzard Entertainment

VAO++: Practical Volumetric Ambient Occlusion for Games

Next-Generation Graphics on Larrabee. Tim Foley Intel Corp

Streaming Massive Environments From Zero to 200MPH

Computer Graphics 10 - Shadows

Consider a partially transparent object that is illuminated with two lights, one visible from each side of the object. Start with a ray from the eye

GPU-Accelerated Deep Shadow Maps

Conemarching in VR. Johannes Saam Mariano Merchante FRAMESTORE. Developing a Fractal experience at 90 FPS. / Framestore

Pipeline Operations. CS 4620 Lecture 10

03 RENDERING PART TWO

Profiling and Debugging Games on Mobile Platforms

The Animation Process. Lighting: Illusions of Illumination

Effects needed for Realism. Computer Graphics (Fall 2008) Ray Tracing. Ray Tracing: History. Outline

Multi-View Soft Shadows. Louis Bavoil

PowerVR Graphics - Latest Developments and Future Plans

6.837 Introduction to Computer Graphics Quiz 2 Thursday November 20, :40-4pm One hand-written sheet of notes allowed

Optimizing and Profiling Unity Games for Mobile Platforms. Angelo Theodorou Senior Software Engineer, MPG Gamelab 2014, 25 th -27 th June

PowerVR Performance Recommendations The Golden Rules. October 2015

Rendering Algorithms: Real-time indirect illumination. Spring 2010 Matthias Zwicker

SUMMARY. CS380: Introduction to Computer Graphics Ray tracing Chapter 20. Min H. Kim KAIST School of Computing 18/05/29. Modeling

Previously... contour or image rendering in 2D

Me Again! Peter Chapman. if it s important / time-sensitive

Image Processing Tricks in OpenGL. Simon Green NVIDIA Corporation

Last Time: Acceleration Data Structures for Ray Tracing. Schedule. Today. Shadows & Light Sources. Shadows

Transcription:

Enhancing Traditional Rasterization Graphics with Ray Tracing March 2015

Introductions James Rumble Developer Technology Engineer Ray Tracing Support Justin DeCell Software Design Engineer Ray Tracing Visualizer 2

Overview PowerVR Ray Tracing Introduction: What is Ray Tracing? PowerVR Ray Tracing Pipeline Hybrid Ray Tracing Fast Ray Traced Soft Shadows Conclusion 3

What is Ray Tracing?

Tracing Rays Forward Ray Tracing vs Backward Ray Tracing Rays used to model real-world behaviour of light. Forward Ray Tracing: Rays traced from the light source. Many rays never reach our eyes. Backward Ray Tracing: Rays traced from the eye towards light. 5

Tracing Rays Forward Ray Tracing vs Backward Ray Tracing Rays used to model real-world behaviour of light. Forward Ray Tracing: Rays traced from the light source. Many rays never reach our eyes. Backward Ray Tracing: Rays traced from the eye towards light. 6

Tracing Rays Forward Ray Tracing vs Backward Ray Tracing Rays used to model real-world behaviour of light. Forward Ray Tracing: Rays traced from the light source. Many rays never reach our eyes. Backward Ray Tracing: Rays traced from the eye towards light. 7

Tracing Rays Forward Ray Tracing vs Backward Ray Tracing Rays used to model real-world behaviour of light. Forward Ray Tracing: Rays traced from the light source. Many rays never reach our eyes. Backward Ray Tracing: Rays traced from the eye towards light. 8

Tracing Rays Forward Ray Tracing vs Backward Ray Tracing Rays used to model real-world behaviour of light. Forward Ray Tracing: Rays traced from the light source. Many rays never reach our eyes. Backward Ray Tracing: Rays traced from the eye towards light. 9

Tracing Rays Forward Ray Tracing vs Backward Ray Tracing Rays used to model real-world behaviour of light. Forward Ray Tracing: Rays traced from the light source. Many rays never reach our eyes. Backward Ray Tracing: Rays traced from the eye towards light. 10

Tracing Rays Forward Ray Tracing vs Backward Ray Tracing Rays used to model real-world behaviour of light. Forward Ray Tracing: Rays traced from the light source. Many rays never reach our eyes. Backward Ray Tracing: Rays traced from the eye towards light. 11

What is Ray Tracing? Backwards Ray Tracing Primary rays fired from eye through pixels of the screen. Find closest triangle intersection. 12

What is Ray Tracing? Ray Tracing provides the ability for the shading of one object to be aware of the geometry of other objects in the scene. 13

PowerVR Ray Tracing Pipeline

PowerVR Ray Tracing Pipeline Scene Hierarchy Building Phase Ray Traversal Phase Vertex Processing Hierarchy Generation Primary Ray Generation Intersection Tests Ray Shaders Accumulation Memory Geometry Data Scene Hierarchy 15

Scene Hierarchy Generation Geometry Submission Scene Hierarchy Building Phase Ray Traversal Phase Vertex Processing Hierarchy Generation Primary Ray Generation Intersection Tests Ray Shaders Accumulation Memory Geometry Data Scene Hierarchy Geometry Submission Scene Components Scenes 16

Scene Hierarchy Generation Scene Components Windshield Scene Component: - Program: - Vertex Shader - Ray Shader - Uniforms - Geometry Data - Buffers - Textures Chrome Scene Component: - Program: - Vertex Shader - Ray Shader - Uniforms - Geometry Data - Buffers - Textures Car Body Scene Component: - Program: - Vertex Shader - Ray Shader - Uniforms - Geometry Data - Buffers - Textures Headlights Scene Component: - Program: - Vertex Shader - Ray Shader - Uniforms - Geometry Data - Buffers - Textures Tyres Scene Component: - Program: - Vertex Shader - Ray Shader - Uniforms - Geometry Data - Buffers - Textures 17

Scene Component: - Program: - Vertex Shader - Ray Shader - Uniforms - Geometry Data - Buffers - Textures Scene Component: - Program: - Vertex Shader - Ray Shader - Uniforms - Geometry Data - Buffers - Textures Scene Component: - Program: - Vertex Shader - Ray Shader - Uniforms - Geometry Data - Buffers - Textures Scene Component: - Program: - Vertex Shader - Ray Shader - Uniforms - Geometry Data - Buffers - Textures Scene Component: - Program: - Vertex Shader - Ray Shader - Uniforms - Geometry Data - Buffers - Textures Scene Component: - Program: - Vertex Shader - Ray Shader - Uniforms - Geometry Data - Buffers - Textures Scene Component: - Program: - Vertex Shader - Ray Shader - Uniforms - Geometry Data - Buffers - Textures Scene Component: - Program: - Vertex Shader - Ray Shader - Uniforms - Geometry Data - Buffers - Textures Scene Component: - Program: - Vertex Shader - Ray Shader - Uniforms - Geometry Data - Buffers - Textures Scene Component: - Program: - Vertex Shader - Ray Shader - Uniforms - Geometry Data - Buffers - Textures Scene Component: - Program: - Vertex Shader - Ray Shader - Uniforms - Geometry Data - Buffers - Textures Scene Component: - Program: - Vertex Shader - Ray Shader - Uniforms - Geometry Data - Buffers - Textures Scene Component: - Program: - Vertex Shader - Ray Shader - Uniforms - Geometry Data - Buffers - Textures Scene Component: - Program: - Vertex Shader - Ray Shader - Uniforms - Geometry Data - Buffers - Textures Scene Component: - Program: - Vertex Shader - Ray Shader - Uniforms - Geometry Data - Buffers - Textures Scene Hierarchy Generation Scenes Contain groups of components. Ray traversal occurs within scene. Windshield Chrome Windshield Chrome Car Body Car Body Headlights Tyres Headlights Tyres Windshield Chrome Car Body Headlights Tyres 18

Scene Hierarchy Generation Vertex Processing Scene Hierarchy Building Phase Ray Traversal Phase Vertex Processing Hierarchy Generation Primary Ray Generation Intersection Tests Ray Shaders Accumulation Memory Geometry Data Scene Hierarchy 19

Scene Hierarchy Generation Vertex Processing Vertex shader used to transform geometry to world space. 20

Scene Hierarchy Generation Hierarchy Generation Scene Hierarchy Building Phase Ray Traversal Phase Vertex Processing Hierarchy Generation Primary Ray Generation Intersection Tests Ray Shaders Accumulation Memory Geometry Data Scene Hierarchy 21

Scene Hierarchy Generation Hierarchy Generation Organises triangles based on their size and position. Application developer does not need to worry about handling this. Simple Build command. 22

Scene Hierarchy Generation Hierarchy Generation Organises triangles based on their size and position. Application developer does not need to worry about handling this. Simple Build command. 23

Scene Hierarchy Generation Hierarchy Generation Organises triangles based on their size and position. Application developer does not need to worry about handling this. Simple Build command. 24

Scene Hierarchy Generation Hierarchy Generation Organises triangles based on their size and position. Application developer does not need to worry about handling this. Simple Build command. 25

Scene Ray Traversal Scene Hierarchy Building Phase Ray Traversal Phase Vertex Processing Hierarchy Generation Primary Ray Generation Intersection Tests Ray Shaders Accumulation Memory Geometry Data Scene Hierarchy 26

Scene Ray Traversal Primary Ray Generation Scene Hierarchy Building Phase Ray Traversal Phase Vertex Processing Hierarchy Generation Primary Ray Generation Intersection Tests Ray Shaders Accumulation Memory Geometry Data Scene Hierarchy 27

Scene Ray Traversal Primary Ray Generation Frame Shaders: Run once per pixel to emit primary rays into the scene. Common case fire a ray per-pixel over a full-screen quad. Alternatively Frame shader can be setup as any m x n dimension. 28

Scene Ray Traversal Intersection Tests Scene Hierarchy Building Phase Ray Traversal Phase Vertex Processing Hierarchy Generation Primary Ray Generation Intersection Tests Ray Shaders Accumulation Memory Geometry Data Scene Hierarchy 29

Scene Ray Traversal Intersection Tests Simple approach each ray tested against all triangles: Brute force. m * n intersection tests (m rays, n objects). Use accelerated data structure to reduce intersection tests. Application developer does not need to worry about handling this. Accelerated triangle and box testing. 30

Scene Ray Traversal Intersection Tests Simple approach each ray tested against all triangles: Brute force. m * n intersection tests (m rays, n objects). Use accelerated data structure to reduce intersection tests. Application developer does not need to worry about handling this. Accelerated triangle and box testing. 31

Scene Ray Traversal Intersection Tests Simple approach each ray tested against all triangles: Brute force. m * n intersection tests (m rays, n objects). Use accelerated data structure to reduce intersection tests. Application developer does not need to worry about handling this. Accelerated triangle and box testing. 32

Scene Ray Traversal Intersection Tests Simple approach each ray tested against all triangles: Brute force. m * n intersection tests (m rays, n objects). Use accelerated data structure to reduce intersection tests. Application developer does not need to worry about handling this. Accelerated triangle and box testing. 33

Scene Ray Traversal Ray Shaders and Accumulation Scene Hierarchy Building Phase Ray Traversal Phase Vertex Processing Hierarchy Generation Primary Ray Generation Intersection Tests Ray Shaders Accumulation Memory Geometry Data Scene Hierarchy 34

Scene Ray Traversal Ray Shaders and Accumulation Ray Shaders: Defined for each component and invoked when a ray intersects a triangle. Defines material properties of component. Can emit further rays causing additional intersection tests. accumulate(0.85, 0.85, 0.75); reflect(incidentdirection, normal) 35

Pipeline Summary Scene Hierarchy Building Phase Ray Traversal Phase Vertex Processing Hierarchy Generation Primary Ray Generation Intersection Tests Ray Shaders Accumulation Memory Geometry Data Scene Hierarchy Geometry Submission Scene Components Scenes 36

Pipeline Summary Scene Hierarchy Building Phase Ray Traversal Phase Vertex Processing Hierarchy Generation Primary Ray Generation Intersection Tests Ray Shaders Accumulation Memory Geometry Data Scene Hierarchy Geometry Submission Scene Components Scenes 37

Pipeline Summary Scene Hierarchy Building Phase Ray Traversal Phase Vertex Processing Hierarchy Generation Primary Ray Generation Intersection Tests Ray Shaders Accumulation Memory Geometry Data Scene Hierarchy Geometry Submission Scene Components Scenes 38

Hybrid Ray Tracing

How do we use it? Hybrid Ray Traced Graphics Hybrid Shadows, Reflections, etc. Augmented Reality Production- Order-Independent Quality Renders Transparency Ambient Occlusion Asset creation / compression Global Illumination Physics & Collision Detection Virtual Reality Lens correction, Ultra-low latency rendering, Lenticular Displays A.I. & Line of Sight Calculations Rapid photoquality output 40

How do we use it? Light Maps and Probe Baking In Unity Editor 5 41

How do we use it? Hybrid Ray Traced Graphics 42

Modern raster-based game engine Deferred shading used in many modern game engines Render the scene into a deep frame buffer (G-Buffer) G-Buffer Material IDs Normals Lighting Buffer(s) Compute Lighting on each G-Buffer pixel (No Overdraw) World-Space Positions or depth buffer Lighting calculations executed in screen space Assemble the final frame and perform screen-space effects Final Result Frame 43

Ray Trace using the G-Buffer Who needs primary rays when we have rasterization? G-Buffer Material IDs Normals World Space Positions or Depth values (1.0,0.0,0.0) (0.5,0.6,-0.2) (14.3,81.6,-0.4) 44

Ray Trace using the G-Buffer Who needs primary rays when we have rasterization? G-Buffer Material IDs Normals World Space Positions or Depth values (1.0,0.0,0.0) (0.5,0.6,-0.2) (14.3,81.6,-0.4) 45

Hybrid Ray Tracing Use the G-Buffer to setup your rays Render the scene into a deep frame buffer (G-Buffer) G-Buffer Material IDs Normals Lighting Buffer(s) Trace Rays to determine lighting World-Space Positions or depth buffer Assemble the final frame and perform screen-space effects Final Result Frame 46

Fast Ray Traced Soft Shadows

Cascaded Shadow Maps State of the art non-ray tracing technique Render a shadow map slice for each light at each resolution View 48

Cascaded Shadow Maps State of the art non-ray tracing technique Render a shadow map slice for each light at each resolution View 49

Cascaded Shadow Maps State of the art non-ray tracing technique Render a shadow map slice for each light at each resolution View 50

Cascaded Shadow Maps State of the art non-ray tracing technique Render a shadow map slice for each light at each resolution View 51

Cascaded Shadow Maps State of the art non-ray tracing technique Render a shadow map slice for each light at each resolution View 52

Cascaded Shadow Maps State of the art non-ray tracing technique More shadow detail is stored for objects near to the view View 100 texels per scene unit 50 texels per scene unit 25 texels per scene unit 12 texels per scene unit 53

Cascaded Shadow Maps State of the art non-ray tracing technique Sample from the appropriate slices based on distance from view View 54

Cascaded Shadow Maps State of the art non-ray tracing technique Sample from the appropriate slices based on distance from view View 55

Comparison with Cascaded Shadow Maps State of the art non-ray tracing technique Sample from the appropriate slices based on distance from view 56

Comparison with Cascaded Shadow Maps State of the art non-ray tracing technique Sample from the appropriate slices based on distance from view 57

Ray Traced Shadows

Ray Traced Shadows The basic algorithm for shadowing with ray tracing Shoot a ray between surface and the light: If the ray hits *anything* then do nothing (region is shadowed and unlit) If the ray reaches the light without hitting anything then illuminate that pixel Then you re done! 59

Soft Shadows Shadows with soft edges Shadows have sharp edges at noon on a clear day But many situations cause soft shadows The region where a shadow transitions between fully and partially lit is called the penumbra. In the real world Light sources are not infinitely small points Scattering occurs between the light source and surface 60

A Simplified Model of Soft Shadows Penumbra size is based on the ratio of the distance to an occluder and the light Light Source Occluder Fully Lit Penumbra Fully Dark Penumbra Fully Lit 61

A Simplified Model of Soft Shadows Knowing the distance to an object, we can calculate the softness of its shadow Light Source Occluder Fully Lit Penumbra Fully Dark Penumbra Fully Lit 62

A Simplified Model of Soft Shadows By knowing the distance to an object, we can calculate the softness of the shadow it casts Light Source Occluder Penumbra Fully Dark Penumbra 63

Algorithm: Distance-To-Occluder Soft Shadows Analytical penumbra calculation based on distance to occluder Shadow rays don t just record hit vs. miss, they also record the distance to the occluder on each hit After the ray tracing pass, final pixel s shadow density is calculated with a screen-space filter Pixels in shadow select a filter kernel size based on the stored distance to the occluder Pixels in light perform a limited search to identify the nearby shadows that could darken the pixel Store distance Store distance 64

Algorithm: Distance-To-Occluder Soft Shadows Analytical penumbra calculation based on distance to occluder Easily extended to support transparent objects In addition to distance, store a shadow density value for each pixel that hits an object Only store the distance to the first occluder we encounter Continue ray towards light until we reach the light or shadow density is saturated, i.e. pixel is fully shadowed Store distance Density: 0.5 Discard Ray Density: 1 Discard Ray Store distance Density: 0.5 65

Ray Traced Shadows 66

Ray Tracing Density Buffer 67

Ray Tracing Distance Buffer 68

Penumbra Size Calculation Distance selection in shadow If current pixel in shadow, use current pixel s distance to occluder value 69

Penumbra Size Calculation Distance selection not in shadow Search for shadowed neighboring pixels using cross pattern Select the maximum distance to occluder 70

Penumbra Size Calculation Analytically compute penumbra size Compute penumbra width (P), using distance to occluder (O), distance to the light source (L), and the light radius (R) P = RO L Note: Given an sufficiently far away light, R L can be treated as a constant. 71

Kernel Width Selection Project penumbra width into screen space P w D P s 72

Depth Rejection Preserve discontinuous edges Local differencing to compute partial derivatives with respect to screen space z x = min d 1,0 d 0,0, d 1,0 d 0,0 z y = min ( d 0,1 d 0,0, d 0, 1 d 0,0 ) Compute depth delta between center pixel and pixel sampling, accept sample if within following threshold: d x,y p x z x + p y z y + ε 73

Depth Rejection Preserve discontinuous edges Local differencing to compute partial derivatives with respect to screen space z x = min d 1,0 d 0,0, d 1,0 d 0,0 z y = min ( d 0,1 d 0,0, d 0, 1 d 0,0 ) Compute depth delta between center pixel and pixel sampling, accept sample if within following threshold: d x,y p x z x + p y z y + ε 74

Algorithm: Distance-To-Occluder Soft Shadows Analytical penumbra calculation based on distance to occluder Advantages: No shadow map resolution issues; shadow resolution based on screen resolution Perfect shadow contact ; no Peter Panning No noise or banding Physically plausible penumbra size More efficient than cascaded shadow maps or multi-ray approaches At most, casts 1 ray per pixel, often less Limitations: Visible penumbra size is limited by the kernel size A separate buffer or pass is needed for each light, just like shadow maps Best for daylight scenes with one dominant light, i.e. the sun 75

Results 4 slice, 2k, cascaded shadow maps 76

Results Ray traced shadows 77

Results Over blurring Ray traced Cascaded shadow maps 78

Results 4 slice, 2k, cascaded shadow maps 79

Results Ray traced shadows 80

Results Floating geometry/peter Panning Ray traced Cascaded shadow maps 81

Results 4 slice, 2k, cascaded shadow maps 82

Results Ray traced shadows 83

Results Floating geometry/peter Panning Ray traced Cascaded shadow maps 84

Optimization and Efficiency Analysis

Cast Fewer Rays N L rejection If a surface is facing away from the light, there s no need to cast any rays! A surface is back facing with respect to the light when dot N, L 0.0 Store rejected values as 0.0 in distance buffer, 1.0 in density buffer In the worst case scenario, we still need to cast 1 ray per pixel Most cases we ll be able to reject some number of pixels giving us shadows for < 1 ray per pixel 86

Rending Pipeline Initial implementation G-Buffer Ray Tracing Filtering + Blit Normal RGBA32F Position RGBA32F Distance/Density RG16F Albedo RGBA8 Depth 24 87

Rending Pipeline Better implementation G-Buffer Ray Tracing Filtering + Blit Packed Normal R32UI Position RGBA32F Distance/Density RG8 Albedo RGBA8 Depth 24 88

Rending Pipeline Optimized implementation Framebuffer Fetch G-Buffer Ray Tracing Filtering + Blit Packed Normal R32UI Position RGBA32F Distance/Density RG8 Albedo + N L RGBA8 Depth 24 89

What is Bandwidth? Why you should care about bandwidth Bandwidth consumption is a result of data that must be fetched from main memory (DRAM) Bandwidth = (memory reads + memory writes) / time Texture fetches that miss the cache must read the value from DRAM DRAM fetch is a high latency operation and stalls the shader Each DRAM fetch consumes power vec4 value = texture(utex, uv); DRAM Cache USC USC USC USC 90

Efficiency Analysis Bandwidth for 1280x720 render 91

Efficiency Analysis Bandwidth for 1280x720 render Total Memory Traffic (Reads + Writes) Cascaded Shadow Maps Ray Traced Shadows G-Buffer Only 233.71 MB 164.34 MB 97.01 MB 92

Efficiency Analysis Bandwidth for 1280x720 render Total Memory Traffic (Reads + Writes) Cascaded Shadow Maps Ray Traced Shadows G-Buffer Only 233.71 MB 164.34 MB 97.01 MB Total Shadowing Memory Traffic Cascaded Shadow Maps Ray Traced Shadows 136.70 MB 67.32 MB 93

Efficiency Analysis Bandwidth for 1280x720 render Total Memory Traffic (Reads + Writes) Cascaded Shadow Maps Ray Traced Shadows G-Buffer Only 233.71 MB 164.34 MB 97.01 MB Total Shadowing Memory Traffic Cascaded Shadow Maps Ray Traced Shadows 136.70 MB 67.32 MB 50.7% Shadowing Memory Traffic Reduction 94

Efficiency Analysis Bandwidth for 1280x720 render Cascaded Shadows Ray Traced Shadows* Memory Traffic Reduction 136.70 MB 67.32 MB 50.7% 150.94 MB 62.49 MB 58.6% 159.48 MB 86.51 MB 45.8% *Excludes 61.06 MB one time setup cost for building scene hierarchy 95

Efficiency Analysis Cycles for 1280x720 render @ 600Mhz Cascaded Shadows 27,582,732 cycles 45.97 ms/frame Ray Traced Shadows 13,585,924 cycles 22.64 ms/frame Total Time Reduction 23.3 ms/frame 50.7% 31,643,530 cycles 52.74 ms/frame 14,145,497 cycles 23.58 ms/frame 29.2 ms/frame 55.3% 37,842,299 cycles 63.07 ms/frame 18,975,421 cycles 31.63 ms/frame 31.4 ms/frame 49.6% 96

Conclusion Ray tracing in conjunction with rasterization Shown specific example using ray tracing to improve visual quality and performance More examples of ray tracing in action this afternoon Low Overhead Probe-based Global Illumination Using Ray Tracing @ 1pm 97

www.imgtec.com/idc