Deep Learning For Real Time Graphics
Deep Learning For Real Time Graphics
Marco Salvi
NVIDIA
[Karras17] [Chaitanya17]
[Dahm17]
[Nalbach17]
3
“Open Problems in Real-Time Rendering” Course
What is Deep Learning?
Does it generalize?
hidden layer
output layer
■ Gradient of the loss function provides deltas to update network weights (gradient descent)
♦
♦ The artificial neural network is just a (mostly ) differentiable function!
■ DL frameworks exploit chain rule to efficiently generate gradients with the backpropagation method
10
“Open Problems in Real-Time Rendering” Course
Learning a (useless) Graphics Pipeline
3 (light dir)
16
tanh
128 x 128 x 4 (RGBA)
linear
13
“Open Problems in Real-Time Rendering” Course
Convolutional Layers
■ Fully connected layers are a powerful tool but..
♦ Don’t scale well (curse of dimensionality)
♦ Number of elements to process is wired in the network
♦ No notion of locality
■ Convolutional layers
♦ Limit connectivity to local neighborhood (e.g. 3 x 3 neurons) → locality & improved scaling
♦ Share same weights over the entire layer → resolution independent
■ Can be thought as performing a convolution with the same weights over the entire image
♦ Can perform downscaling and upscaling
Image source: “Unsupervised Learning of Hierarchical Representations with Convolutional Deep Belief Networks” – ICML 2009 and Comm. ACM 2011
Honglak Lee, Roger Grosse, Rajesh Ranganath and Andrew Y. Ng
19
“Open Problems in Real-Time Rendering” Course
Antialiasing Autoencoder
■ Trained with thousands of 8 frame sequences from three different scenes
♦ Captured sequences of 16 spp (unresolved) images
■ Reference images by resolving 4x4 tile = 16 spp to 1 pixel
■ 1 spp images by picking random sample in a 4x4 tile → sub-pixel jittering in time
■ Set LOD bias to +1 when rendering → 1spp image exhibits an effective LOD bias of -1 due to downscaling
■ Required if we want to approach the image quality of a supersampled image
box filters
27
“Open Problems in Real-Time Rendering” Course
Learned TAA
28
“Open Problems in Real-Time Rendering” Course
Learned TAA
■ Generally sharper image than “regular” TAA
♦ Temporal stability seems to be unaffected (still very good)
31
“Open Problems in Real-Time Rendering” Course
Learned TAA
32
“Open Problems in Real-Time Rendering” Course
Warped Recurrent Autoencoder
33
“Open Problems in Real-Time Rendering” Course
Reference (16 spp)
34
“Open Problems in Real-Time Rendering” Course
Antialiasing video: AE vs. Warped RAE
■ Generates more detailed and less biased images than learned TAA
♦ Still very temporally stable
38
“Open Problems in Real-Time Rendering” Course
Denoised with Warped Recurrent Autoencoder
39
“Open Problems in Real-Time Rendering” Course
Denoising Video
41
“Open Problems in Real-Time Rendering” Course
Programming Model and other Grievances
■ A network is just a differentiable program..
♦ ..but deep learning frameworks are designed to build graphs performing operations on tensors
■ At times can feel like writing parallel code using intrinsics for a 1M-wide SIMD processor
■ Doesn’t work well when all you want to do is writing some SIMT code
■ An RNN should just be a loop in the differentiable program, not a special graph node/black box
■ …
■ Lack of support for operations we take for granted in real-time gfx APIs (e.g. texture sampling)
42
“Open Problems in Real-Time Rendering” Course
Implementing TAA was tedious and error prone
43
“Open Problems in Real-Time Rendering” Course
Temporal Stability Is Hard
■ Warped RNNs are a step forward, but many limitations
♦ Not always possible to have accurate motion vectors
■ e.g. transparent layers, dynamic shadows, reflections, refractions, animated UVs, etc.
♦ Antialiasing
♦ Upsampling / super-resolution
♦ Foveation
♦ …
■ Denoising
♦ Soft shadows
♦ Motion & defocus blur
♦ Interactive path tracing
45
“Open Problems in Real-Time Rendering” Course
Countless Opportunities..
■ Models
♦ Automated appearance-preserving LODs
♦ Blended animations that look natural
♦ New geometry representations?
■ Shading
♦ Faster / higher quality / pre-filtered materials
♦ Learning more optimal G-buffer terms/format
■ Will deep learning take over significant parts of the graphics pipeline?
52
“Open Problems in Real-Time Rendering” Course
“Open Problems in Real-Time Rendering” Course