Real time path tracing using a hybrid deferred approach · Deferred Path Tracing Overview for...

18
Real-time path tracing using a hybrid deferred approach GTC EUR 2017, Talk #23026 Thomas Schander @ThomasSchander Clemens Musterle

Transcript of Real time path tracing using a hybrid deferred approach · Deferred Path Tracing Overview for...

Page 1: Real time path tracing using a hybrid deferred approach · Deferred Path Tracing Overview for diffuse and specular GBuffer Last frame‘s reprojection Decide if new ray is necessary

Real-time path tracing using ahybrid deferred approach

GTC EUR 2017, Talk #23026

Thomas Schander@ThomasSchander

Clemens Musterle

Page 2: Real time path tracing using a hybrid deferred approach · Deferred Path Tracing Overview for diffuse and specular GBuffer Last frame‘s reprojection Decide if new ray is necessary

What stops us from real-time PT?

Unbiased qualityHigh performance

How can we create an intermediate, scalable solution?

Page 3: Real time path tracing using a hybrid deferred approach · Deferred Path Tracing Overview for diffuse and specular GBuffer Last frame‘s reprojection Decide if new ray is necessary

What is Enscape?

Real-time rendering plugin for architectural construction programs

Used by 78 of the Top 100 architecture companiesworld wide

The construction tool serves as the editorWYSIWYG for CAD model changesHuge projects, massive polycount, unpreparedfor renderingOffline quality without precalculation

Page 4: Real time path tracing using a hybrid deferred approach · Deferred Path Tracing Overview for diffuse and specular GBuffer Last frame‘s reprojection Decide if new ray is necessary
Page 5: Real time path tracing using a hybrid deferred approach · Deferred Path Tracing Overview for diffuse and specular GBuffer Last frame‘s reprojection Decide if new ray is necessary
Page 6: Real time path tracing using a hybrid deferred approach · Deferred Path Tracing Overview for diffuse and specular GBuffer Last frame‘s reprojection Decide if new ray is necessary
Page 7: Real time path tracing using a hybrid deferred approach · Deferred Path Tracing Overview for diffuse and specular GBuffer Last frame‘s reprojection Decide if new ray is necessary

Problems of real-time GI

Light leaking Offscreen reflectionsIncompatible to complex BRDFs Indirect shadowsHigh frequency indirect lightingPrecomputation necessaryDo not scale to ground truthScene size assumptions

SSDO, Ritschel

Voxel Cone Tracing, Crassin

Light Field Probes, McGuire

LPVs, Kaplanyan

Page 8: Real time path tracing using a hybrid deferred approach · Deferred Path Tracing Overview for diffuse and specular GBuffer Last frame‘s reprojection Decide if new ray is necessary

Deferred Path TracingOverview for diffuse and specular

GBuffer

Last frame‘sreprojection

Decide if new ray isnecessary Trace in SS Trace in BVH Filter

BVH constructionRay queue

Radiance buffer

or

Page 9: Real time path tracing using a hybrid deferred approach · Deferred Path Tracing Overview for diffuse and specular GBuffer Last frame‘s reprojection Decide if new ray is necessary

Hybrid Approach

Rasterization techniques where possibleGbufferShadow MapsPost processing techniques

Complements rasterization renderingEliminates the need for primary rays

Page 10: Real time path tracing using a hybrid deferred approach · Deferred Path Tracing Overview for diffuse and specular GBuffer Last frame‘s reprojection Decide if new ray is necessary

Ray traversal scheme

Sample arbitrary BRDF with N number of rays per fragmentCheck for ray in screen space

If not, append to queue and traverse BVH laterTemporally accumulate per pixel radiance and recycle until fragment can‘t be reusedLazy request of new rays only when sampling density becomes too low

Page 11: Real time path tracing using a hybrid deferred approach · Deferred Path Tracing Overview for diffuse and specular GBuffer Last frame‘s reprojection Decide if new ray is necessary

BVH Construction

Async BVH construction and streaming with LOD based on scene locationCalculate a score for each object based on its occlusion relevance vs traversal costInclude the best objects until maximum BVHsize is reachedBake direct artificial light

Evaluate sun shading at traversal time to allowquick time of day changes

Page 12: Real time path tracing using a hybrid deferred approach · Deferred Path Tracing Overview for diffuse and specular GBuffer Last frame‘s reprojection Decide if new ray is necessary

Sample Accumulation

Calculate desired spp based on albedo, material parameters and direct light amount

Skip ray if spp is sufficientUse variable filter kernel depending on number of existing samples in sample accumulation bufferKeep accumulating for a while when camera stops before idling

Add more spp for powerful machines

Page 13: Real time path tracing using a hybrid deferred approach · Deferred Path Tracing Overview for diffuse and specular GBuffer Last frame‘s reprojection Decide if new ray is necessary

Sample Accumulation

Variance tile-based over the wholeimage to stop accumulating where wereached a sufficient noise level

𝜎 = 𝑎𝑣𝑔2 − 𝑎𝑣𝑔𝑆𝑞𝑟

Bicubic tile filtering for stenciling and erosion mask for passes that are thesource of a non-local filter kernel

Page 14: Real time path tracing using a hybrid deferred approach · Deferred Path Tracing Overview for diffuse and specular GBuffer Last frame‘s reprojection Decide if new ray is necessary

Ground Truth Comparison

Reliable in-app debug validation of indirect lighting resultsCPU based classic path tracerSame shading models as real-time rendererOutputs an HDR target which is theninjected into the normal post processingchain

Allows to toggle results immediately

Page 15: Real time path tracing using a hybrid deferred approach · Deferred Path Tracing Overview for diffuse and specular GBuffer Last frame‘s reprojection Decide if new ray is necessary

Ground Truth Comparison

EnscapeGround Truth

Page 16: Real time path tracing using a hybrid deferred approach · Deferred Path Tracing Overview for diffuse and specular GBuffer Last frame‘s reprojection Decide if new ray is necessary

Ground Truth Comparison

Ground Truth Enscape

Page 17: Real time path tracing using a hybrid deferred approach · Deferred Path Tracing Overview for diffuse and specular GBuffer Last frame‘s reprojection Decide if new ray is necessary

Results

Pass msGBuffer 0.7Direct Light 0.6Transparency 1.8Diffuse Rays 1.4Diffuse Filtering 2.5Specular Rays 1.6Specular Filtering 0.3Post Processing 1.6Total 10.5

Average Timings @1080p on GTX1080

Reaches stable real-time frameratesScalable for low spec machines & VR (spp, range) up to ground truthAsync BVH Update every 2 secondsScales well even to huge architectural projectsComplete diffuse & specular indirect light paths except for caustics and indirect specularAlmost no light leaking. Only cause are missingrelevant objects in BVH, which is rare.

Page 18: Real time path tracing using a hybrid deferred approach · Deferred Path Tracing Overview for diffuse and specular GBuffer Last frame‘s reprojection Decide if new ray is necessary

Thank you!

Contact us for licensing or APIWe‘re hiring for our office in Karlsruhe, Germany

www.enscape3d.com