SlideShare a Scribd company logo
Advances in Real-Time Rendering in
3D Graphics and Games Course
Advances in Real-Time Rendering in
3D Graphics and Games Course
The Technology Behind the
“Unreal Engine 4 Elemental demo”
Advances in Real-Time Rendering in
3D Graphics and Games Course
Martin Mittring
Senior Graphics Architect
Martin.Mittring@EpicGames.com
Epic Games, Inc.
Advances in Real-Time Rendering in
3D Graphics and Games CourseOverview
 Real-time Demo
 Graphical Features
 Indirect Lighting
 Shading
 Post Processing
 Particles
 Questions
Advances in Real-Time Rendering in
3D Graphics and Games Course
Elemental demo
 GDC 2012 demo behind closed doors
 Demonstrate and drive development of Unreal® Engine 4
 NVIDIA® Kepler GK104 (GTX 680)
 Direct3D® 11
 No preprocessing
 Real-time
 30 fps
 FXAA
 1080p at 90%
Advances in Real-Time Rendering in
3D Graphics and Games CourseReal-Time Demo
Advances in Real-Time Rendering in
3D Graphics and Games Course
Transition to Unreal Engine 4
 Shrink
 Removed rarely used features
 Unify renderer interface using Direct3D 11 as guidance
 Research
 Samaritan demo (Direct3D 11, Deferred shading, Tessellation, …)
 Elemental demo (Global Illumination, …)
 Expand
 Bigger changes (Derived Data cache, new Editor UI, …)
Advances in Real-Time Rendering in
3D Graphics and Games Course
Working on Unreal Engine 4
 This caught our attention:
Interactive Indirect Illumination and Ambient Occlusion
Using Voxel Cone Tracing [Crassin11]
More details:
Beyond Programmable Shading Course
Tuesday, 9 am - 12 pm
Advances in Real-Time Rendering in
3D Graphics and Games CourseIndirect Lighting
Advances in Real-Time Rendering in
3D Graphics and Games Course
 Volume ray casting [Groeller05]
 Start with some start bias
 Content adaptive step size
 Lookup radiance and occlusion
 Accumulate light with occlusion
 Stop if occluded or far enough
 Cone trace
 Mip level from local cone width
 Progressively increasing step size
Voxel Cone Tracing Concept
Cone
Voxel
Data
Advances in Real-Time Rendering in
3D Graphics and Games Course
Using Voxel Cone Tracing for GI 1/2
 Like “Ray-tracing into a simplified scene”
 Diffuse GI:
 Multiple directions depending on normal
 Opening angle from cone count
 Specular Reflections:
 Direction from mirrored eye vector
 Opening angle from Specular Power
 Not as precise as ray-tracing but
 Fractional geometry intersection
 No noise
 Level of detail
Advances in Real-Time Rendering in
3D Graphics and Games Course
Using Voxel Cone Tracing for GI 2/2
 [Crassin11] can be further optimized / approximated
 Lower Voxel Resolution
 Gather instead of scatter in Voxel Lighting pass
 Adaptive sampling, sample reuse
 Additional Benefits
 Shadowed IBL
 Shadowed area lights
from emissive materials
VL enabledVL disabled
Advances in Real-Time Rendering in
3D Graphics and Games Course
Voxel Cone Tracing Challenges
 Stepping through thin walls
 Wide cones show artifacts but narrow cones are slow
 Mip maps need to be direction dependent
 Creating voxel data from triangle meshes
 Run-time memory management
 Efficient implementation on GPU hardware
 Sparse data structures
Advances in Real-Time Rendering in
3D Graphics and Games Course
Sparse Voxel Octree
 Mapping function allows locally higher resolution
 World 3D position <=> Index and local 3D position
 Fully maintained on GPU
 Index to access render stage specific data
 Per node/leaf data
 2x2x2 voxel data (placed at octree node corners)
 6x 3x3x3 voxel data (like 2x2x2 with additional border)
Advances in Real-Time Rendering in
3D Graphics and Games Course
Filter and
Finalize
Voxelization
Diffuse
Sampling
Screen
Space
Voxel
Space
Specular
Sampling
Voxel Lighting Pipeline
each frameon demand
Lighting
Advances in Real-Time Rendering in
3D Graphics and Games Course
 Create voxel geometry data in a Region
 Input: Octree, Triangle Mesh, Instance Data, Materials, Region
 Output: Octree, 2x2x2 material attributes, normal
 Region revoxelization
 Geometry changes
 Material changes
 Resolution changes
 Optimized for few dynamic objects
 Revoxelize on demand
 Region keeps static voxel data separate
Voxelization 1/2
3D Scene
Voxel resolution as color
Advances in Real-Time Rendering in
3D Graphics and Games Course
Voxelization 2/2
 Pixel shader pass using hardware rasterizer
 One rasterization pass per axis (X, Y, Z) to avoid holes
 Shader evaluates artist defined material
 Output: fragment queue that is processed by following CS
 Compute Shader pass
 Update octree data structures (in parallel)
 Stores voxel data in leaves
 2 Pass method
 Better occupancy for second pass (2x2 quad)
 Shader compile time (reuse CS)
Advances in Real-Time Rendering in
3D Graphics and Games Course
Voxel Lighting
 Compute shading and store Radiance
 Input: 2x2x2 material attributes, normal
 Output: 2x2x2 HDR color and opacity
 Accumulate Irradiance and Shade
 Add direct light with shadow maps
 Add ambient color
 Combine with albedo color
 Add emissive color
3D Scene
Voxel Lighting Data
Advances in Real-Time Rendering in
3D Graphics and Games Course
 Generate mip-maps, Create redundant border, Compress
 Input: 2x2x2 HDR color, occlusion and normal
 Output: HDR multiplier, 6 x 3x3x3 LDR color and occlusion
 Generate directionally dependent voxel
 See view dependent voxels in [Gobbetti05]
 At leaf level from voxel normal
 At node level from same direction only
Filter Voxels and Finalize
Directionally independent Directionally dependent
Advances in Real-Time Rendering in
3D Graphics and Games Course
The Cone Trace function

 Traverse tree to find node index and node local position
 3 tri-linear filtered lookups in 32 bit volume texture to get 3 directions
 Weight results based on direction (Ambient Cube [McTaggart04])

 Calls SVOLookup() many times
 Get all lighting coming from the given direction in a cone
float4 HDRColorAndOcclusion = SVOLookupLevel (float3 Pos, int Mip, float3 Direction)
float4 HDRColorAndOcclusion = SVOConeTrace (float3 Pos, float3 Direction, float ConeAngle)
Advances in Real-Time Rendering in
3D Graphics and Games Course
Specular Sampling 1/2
 Per pixel local reflections
 Cone angle from Specular Power
 Single cone usually sufficient
 Complex BRDF possible
 Adaptive for better performance
 Specular brightness
 Depth difference
 Normal difference
Up-sample in X
Scatter Specular
Up-sample in Y
Scatter Specular
Specular
Refinement
Point Queue
Half Res
Full Res
Refinement
Point Queue
Advances in Real-Time Rendering in
3D Graphics and Games Course
 Up-sample pass using Dispatch()
 Scatter passes use DispatchIndirect()
Specular Sampling 2/2
uint Pos = 0;
InterlockedAdd(State[STATE_Count], 1, Pos);
InterlockedMax(State[STATE_ThreadGroupCountX], (Pos+63)/64); // saves one pass
RWScratchColors[Pos] = (ThreadId.y << 16) | ThreadId.x;
Half Res Adaptive ResultRefinement
Point Queue
Reference
Advances in Real-Time Rendering in
3D Graphics and Games Course
Diffuse Sampling 1/2
 Similar to Final Gathering [Jensen02]
 Problem:
 Few samples for good performance
 Enough samples for quality (cone angle)
 Well distributed over hemisphere to reduce error
 Don’t want noise
 Don’t want to blur over normal details
 Diffuse is mostly low frequency
 Coherency important for efficiency
Advances in Real-Time Rendering in
3D Graphics and Games Course
 Non-interleaved processing of interleaved 3x3 pattern [Segovia06]
 9 well distributed cones in world space
 Loop over 9 directions, then XY
 Reject samples behind surface normal
 Output non interleaved
 Compositing Pass:
 Recombine non interleaved sub images
 Weight by normal and depth
 5x5 filter to account for missing samples
 Multiply with Albedo color
Diffuse Sampling 2/2
5 6 4 5 6 4
8 9 7 8 9 7
2 3 1 2 3 1
5 6 4 5 6 4
8 9 7 8 9 7
2 3 1 2 3 1
……….
……….
……….
……….
Interleaved
Non Interleaved
Samples on Sphere
Advances in Real-Time Rendering in
3D Graphics and Games Course
Voxel Lighting Examples 1/3
enableddisabled
Advances in Real-Time Rendering in
3D Graphics and Games Course
Voxel Lighting Examples 2/3
Advances in Real-Time Rendering in
3D Graphics and Games Course
Voxel Lighting Examples 3/3
enableddisabled
Advances in Real-Time Rendering in
3D Graphics and Games CourseShading
Advances in Real-Time Rendering in
3D Graphics and Games Course
Advances in Real-Time Rendering in
3D Graphics and Games Course
Deferred Shading
Name Format Usage
Depth D24 Depth
Stencil S8 Stencil masking
SceneColor R16G16B16A16f RGB: Emissive and Light Accumulation
GBufferA R10G10B10A2 RGB: WS Normal, A: Lighting Model
GBufferB R8G8B8A8 RGB: Specular, A: Ambient Occlusion
GBufferC R8G8B8A8 RGB: Diffuse, A:Opacity or Decal Mask
GBufferD R8G8B8A8 R: Specular Power*, GBA: Subsurface Color
* not in alpha channel because of frame buffer blending limitations
 Classic deferred shading in PS (one forward pass)
Advances in Real-Time Rendering in
3D Graphics and Games Course
New Specular Power Encoding
NewEncode(x): (log2(Value) + 1) / 19
NewDecode(x): exp2(Value * 19 - 1)
1.0
0.0
OldEncode(x): sqrt(x / 500)
OldDecode(x): x * x * 500
1.0
0.0
 Higher Specular Power for IBL
 More definition for common values
 Tweaked to give pixel sharp reflection
on a far sphere of width 1000 pixel
Old
New
Advances in Real-Time Rendering in
3D Graphics and Games Course
Gaussian Specular
Dot = saturate(dot(N, H))
Threshold = 0.04
CosAngle = pow(Threshold, 1 / BlinnPhongSpecularPower)
NormAngle = (Dot - 1) / (CosAngle – 1)
LightSpecular = exp(- NormAngle * NormAngle) * Lambert
GaussianPhong
 Gaussian Specular for less aliasing [McKesson12]
 Our empirical approximation
Advances in Real-Time Rendering in
3D Graphics and Games Course
Area Light Specular
 Soft Sphere Area Light
 Energy conserving (approximation) different radii
LightAreaAngle = atan(AreaLightFraction / LightDistance)
ACos = acos(CosAngle)
CosAngle = cos(ACos + LightAreaAngle)
SpecularLighting /= pow(ACos + LightAreaAngle, 2) * 10
Advances in Real-Time Rendering in
3D Graphics and Games Course
Specular Comparison
Area Light + IBLPoint Light + IBL
Area LightPoint Light
Advances in Real-Time Rendering in
3D Graphics and Games CoursePost Processing
Advances in Real-Time Rendering in
3D Graphics and Games Course
New post processing graph
 Graph:
 Created each frame
 No User Interface
 Dependencies define execution order
 RT on demand, ref. counting, lazy release
 Node:
 Many types but fixed function
 Multiple inputs and outputs
 Defines output texture format
UpScale
avg. 4 samples
ToneMap
HDR to LDR
GaussianBlurX
DownSample
4 to1
PostProcessAA
FXAA
TextureInput
Scene Color
GaussianBlurY
Example Graph
Advances in Real-Time Rendering in
3D Graphics and Games Course
Screen Space Ambient Occlusion
 Classic SSAO [Kajalin09]
 Ambient occlusion computed as post process
 Only requires z buffer and 3d point samples
 Few samples are permutated with small screen aligned pattern
 Our technique is based on 2d point samples
 Angle based similar to HBAO [Sainz08]
 Using GBuffer normal improves quality further
 Complements Voxel Lighting with high frequency details
Advances in Real-Time Rendering in
3D Graphics and Games Course
 We use 6 sample pairs = 12 samples into half res z buffer
 16 rotations with scale interleaved in 4x4 pattern
SSAO sampling
+ =
6 Samples
pairs
16 rotations with scale
in 4x4 pixel block
192 samples
in 4x4 pixel block
Advances in Real-Time Rendering in
3D Graphics and Games Course
SSAO with per pixel normal
 Per pixel normal further restricts angle
A B C D E
A) Given: z buffer in the sample direction
B) Get equi-distant z values from samples
C) AO (so far) = min((angle_left+angle_right)/180,1)
D) Clamp against per pixel normal
E) AO (per pixel normal) = (angle_left+angle_right)/180
AO ~= 1-saturate(dot(VecA,Normal)/length(VecA))
Advances in Real-Time Rendering in
3D Graphics and Games Course
SSAO Example
SSAO with per pixel NormalSSAO (Depth only)
Advances in Real-Time Rendering in
3D Graphics and Games Course
SSAO Example Close-up
SSAO with per pixel NormalSSAO (Depth only)
Advances in Real-Time Rendering in
3D Graphics and Games Course
Image Based Lens Flares 1/2
 Lens flares are out of focus reflections on the camera lens
 Image based method
 Threshold and blur bright image parts
 Scale and mirror image multiple times
 Soft mask screen borders
 Lens/Bokeh Blur (for out of focus)
 Render a textured sprite for each very bright low res pixel
 Ideally for each lens reflection with different radius
Advances in Real-Time Rendering in
3D Graphics and Games Course
Source Image with Bloom
Image Based Lens Flares 2/2
IB Lens Flares (without Lens Blur)
IB Lens Flares (with Lens Blur)Lens Blur Sprite Image
Advances in Real-Time Rendering in
3D Graphics and Games Course
IB Lens Flares Examples
Emissive (Sun) Emissive (Fire) Reflections
Advances in Real-Time Rendering in
3D Graphics and Games Course
HDR Histogram [Scheuermann07]
 64 Buckets, logarithmic, no atomics
 Pass 1: Generate screen local histograms (CS) in parallel
 Pass 2: Combine all lines into one
 64 Buckets are stored in 16 ARGB
Clear groupshared histograms float[64][16]
Sync
Accumulate histograms in parallel
Sync
Accumulate many Histograms to one float4[16]
Output one Histogram per line in 16 texels
Advances in Real-Time Rendering in
3D Graphics and Games Course
Eye Adaptation
 Compute average brightness from Histogram (blue line)
 Consider only bright areas (e.g. >90%)
 Reject few very bright areas (very bright emissive, e.g. >98%)
 Compute single multiplier for whole view port
 Smoothly blend with last frame average (white bar)
 Bound in user specified region (green)
 Apply in tone mapper (white curve)
 Read result in tone mapping VS
 Pass to PS as interpolator
Advances in Real-Time Rendering in
3D Graphics and Games CourseParticles
Advances in Real-Time Rendering in
3D Graphics and Games Course
GPU accelerated particles
 CPU
 Spawn particles (arbitrarily complex logic)
 Memory management in fixed size buffers (unit: 16 particles)
 Emitter management (Index buffer, draw call sorting)
 GPU
 Motion from Newtonian mechanics (fixed function)
 Lighting from non directional volume cascades (3D lookups)
 GPU Radix depth sort if required [Merrill11] [Satish09]
 Rendering
 Additional forces from Vector Fields* (3D lookup)
 Particle Curves to modulate particle attributes* (1D lookup)
* See next slides
Advances in Real-Time Rendering in
3D Graphics and Games Course
Particle Attributes
 State-full simulation [Lutz04]
 Allows more complex animations
 Stored over particle lifetime
 Particle Curves: Time Phase and Scale
Name Format Usage
Position R32G32B32A32f World Space Position*, Time Phase
Velocity R16G16B16A16f World Space Velocity, Time Scale
Render Attrib. R8G8B8A8 Size, Rotation
Simulation Attrib. R8G8B8A8 Drag, Vector Field Scale, Random Seed
Advances in Real-Time Rendering in
3D Graphics and Games Course
 Concept
 1D Function of time
 Artist driven (arbitrary complex)
 Implementation
 Filtered texture lookup (Piecewise linear, equidistant)
 Sample count depends on source curve (error threshold)
 Many 1D curves packed into single 2D texture
Particle Curves
Name Format Usage
Attributes R8G8B8A8 Modulate simulation or render attributes
Advances in Real-Time Rendering in
3D Graphics and Games Course
 Per volume attributes
 World to Volume matrix
 Force scale (accumulate)
 Velocity scale (weighted blend)
 Affect all particle systems globally or a single system
 Per volume element attributes
 Can be imported from Maya
 Unified interface for many kind of complex motions
Particle Vector Fields
Name Format Usage
OffsetVector R16G16B16A16f Force or Velocity Delta
Advances in Real-Time Rendering in
3D Graphics and Games Course
Shadow receiving Translucency
Advances in Real-Time Rendering in
3D Graphics and Games Course
Volumetric direct and indirect lighting
Advances in Real-Time Rendering in
3D Graphics and Games Course
> 1 Million Particles
Advances in Real-Time Rendering in
3D Graphics and Games Course
Thanks
 NVIDIA, AMD
 Special thanks to Cyril Crassin and Evan Hart from NVIDIA
 Epic
 Rendering team: Daniel Wright, Andrew Scheidecker, Nick Penwarden
 Everyone that contributed to Unreal Engine 4
Advances in Real-Time Rendering in
3D Graphics and Games Course
Advances in Real-Time Rendering in
3D Graphics and Games CourseEpic Games is hiring
 Work on leading game engine
 Unreal Engine 3
 Upcoming: Unreal Engine 4
 Ship successful games
 Gear Of War 1-3, Infinity Blade 1-2, …
 Upcoming: Fortnite, Infinity Blade: Dungeons
 Target many platforms:
 Xbox 360, PlayStation 3, PC DX9/11,
Mobile, Mac, next gen consoles
 Main office in North Carolina
www.EpicGames.com/jobs
Advances in Real-Time Rendering in
3D Graphics and Games Course
 [Crassin11] Interactive Indirect Illumination and Ambient Occlusion Using Voxel Cone Tracing
Interactive Indirect Illumination Using Voxel Cone Tracing, Sep 2011
http://research.nvidia.com/sites/default/files/publications/GIVoxels-pg2011-authors.pdf
 [Kawase04] Practical Implementation of High Dynamic Range Rendering
http://www.daionet.gr.jp/~masa/archives/GDC2004/GDC2004_PIoHDRR_SHORT_EN.ppt
 [Segovia06] Non-interleaved Deferred Shading of Interleaved Sample Patterns
http://liris.cnrs.fr/Documents/Liris-2476.pdf
 [Kajalin09] Screen Space Ambient Occlusion
ShaderX7 - Advanced Rendering Techniques
 [Sainz08] Image-Space Horizon-Based Ambient Occlusion
http://www.nvidia.com/object/siggraph-2008-HBAO.html
 [Tabellion08] Practical Global Illumination with Irradiance Caching
http://cgg.mff.cuni.cz/~jaroslav/papers/2008-irradiance_caching_class/10-EricSlides.pdf
 [Toksvig05] Mipmapping normal maps. Journal of Graphics Tools 10, 3, 65–71
ftp://download.nvidia.com/developer/Papers/Mipmapping_Normal_Maps.pdf
 [Bruneton11] A Survey of Non-linear Pre-filtering Methods for Efficient and Accurate Surface Shading
http://hal.inria.fr/docs/00/58/99/40/PDF/article.pdf
 [McKesson12] Gaussian Specular from Learning Modern 3D Graphics Programming
http://www.arcsynthesis.org/gltut/Illumination/Tut11%20Gaussian.html
http://arcsynthesis.org/gltut/Illumination/Tut11%20On%20Performance.html
 [Scheuermann07] Efficient Histogram Generation Using Scattering on GPUs
http://developer.amd.com/gpu_assets/GPUHistogramGeneration_I3D07.pdf
References 1/2
Advances in Real-Time Rendering in
3D Graphics and Games Course
 [Gobbetti05] Far Voxels: A Multiresolution Framework for Interactive Rendering of Huge Complex 3D Models on Commodity Graphics Platforms
http://www.crs4.it/vic/cgi-bin/bib-page.cgi?id='Gobbetti:2005:FV‘
 [Mittring11] The Technology Behind the DirectX 11 Unreal Engine "Samaritan" Demo
http://udn.epicgames.com/Three/rsrc/Three/DirectX11Rendering/MartinM_GDC11_DX11_presentation.pdf
 [Lutz04] Building a Million-Particle System
http://www.gamasutra.com/view/feature/130535/building_a_millionparticle_system.php?page=1
 [Lutz11] Everything about Particle Effects
http://www.2ld.de/gdc2007
 [McTaggart04] Half-Life®2 / Valve Source™ Shading
http://www2.ati.com/developer/gdc/D3DTutorial10_Half-Life2_Shading.pdf
 [Merrill11] High Performance and Scalable Radix Sorting
Parallel Processing Letters, vol. 21, no. 2, 2011, pp. 245-272
https://sites.google.com/site/duanemerrill/awards-publications
 [Satish09] Designing Efficient Sorting Algorithms for Manycore GPUs
IPDPS '09: Proceedings of the 2009 IEEE International Symposium on Parallel & Distributed Processing, 2009
http://mgarland.org/files/papers/gpusort-ipdps09.pdf
 [Jensen02] A Practical Guide to Global Illumination using Photon Mapping Siggraph 2002
http://www.cs.princeton.edu/courses/archive/fall02/cs526/papers/course43sig02.pdf
 [Groeller05] A Simple and Flexible Volume Rendering Framework for Graphics-Hardware based Raycasting
http://cumbia.informatik.uni-stuttgart.de/ger/research/pub/pub2005/vg2005-stegmaier.pdf
References 2/2
Advances in Real-Time Rendering in
3D Graphics and Games Course
Questions?
Advances in Real-Time Rendering in
3D Graphics and Games Course
Bonus slides
Advances in Real-Time Rendering in
3D Graphics and Games Course
Bloom 1/2 [Kawase04]
 Goal: Large, high quality, efficient
 Down sample:
 Blur during downsample avoids aliasing
A = downsample2(FullRes)
B = downsample2(A)
C = downsample2(B)
D = downsample2(C)
E = downsample2(D)
Without blur (1sample):
With blur (4 samples):
Advances in Real-Time Rendering in
3D Graphics and Games Course
Bloom 2/2
 Recombine (with increasing resolution):
 Blurring while up sampling
 Improves quality
 Barely affects blur radius
 Combine with dirt texture
E’= blur(E,b5)
D’= blur(D,b4)+E’
C’= blur(C,b3)+D’
B’= blur(B,b2)+C’
A’= blur(A,b1)+B’
blur(blur(X,a),b) ~= blur(X,max(a,b))
Advances in Real-Time Rendering in
3D Graphics and Games Course
Bloom Example
Bloom with 5 Gaussians and DirtBloom with single Gaussian
Advances in Real-Time Rendering in
3D Graphics and Games Course
GBuffer Blur 1/2
 Smart blur:
 Average of 5 pixels
 Weighted by normal
 Weighted by depth difference
 Applications:
 Reduce aliasing of specular materials (noticeable in motion)
 Reduce high frequency dither artifacts in Ambient Occlusion
 Can increase performance of with IBL or Voxel Lighting
Advances in Real-Time Rendering in
3D Graphics and Games Course
GBuffer Blur 2/2
 Using Gather() where possible (Depth, AO)
 Output: SpecularPower, Normal, AmbientOcclusion
 Reduce Specular Power [Toksvig05] [Bruneton11]
L = saturate(length(SumNormal) * 1.002)
SpecularPower *= L / (L + SpecularPower * (1 - L))
X Y
ZW
Kernel using 5 samples single Gather Kernel using 2 Gather
Advances in Real-Time Rendering in
3D Graphics and Games Course
without GBuffer Blur
with GBuffer Blur
Advances in Real-Time Rendering in
3D Graphics and Games Course
SSS Material Example
shadowedunshadowed
Advances in Real-Time Rendering in
3D Graphics and Games Course
Auxiliary to the graph
 Post Process Volume:
 Linearly blends Post process properties
 Priority depending on camera position
 Soft transitions with Blend Radius
 Weight can be controlled remotely
 Render Target Pool:
 Allocation on demand, reference counting
 Deferred release
 Tools to look at intermediate Buffers
Advances in Real-Time Rendering in
3D Graphics and Games Course
Voxel Lighting Examples 3/5
enableddisabled
Advances in Real-Time Rendering in
3D Graphics and Games Course
Advances in Real-Time Rendering in
3D Graphics and Games Course
Voxel Lighting Examples 5/5

More Related Content

PPT
A Bit More Deferred Cry Engine3
guest11b095
 
PPT
CS 354 Shadows
Mark Kilgard
 
PPT
Shadow Mapping with Today's OpenGL Hardware
Mark Kilgard
 
PPT
CS 354 Shadows (cont'd) and Scene Graphs
Mark Kilgard
 
PPT
CS 354 Project 2 and Compression
Mark Kilgard
 
PPT
CS 354 Interaction
Mark Kilgard
 
PDF
Clustered defered and forward shading
WuBinbo
 
PPTX
Lighting you up in Battlefield 3
Electronic Arts / DICE
 
A Bit More Deferred Cry Engine3
guest11b095
 
CS 354 Shadows
Mark Kilgard
 
Shadow Mapping with Today's OpenGL Hardware
Mark Kilgard
 
CS 354 Shadows (cont'd) and Scene Graphs
Mark Kilgard
 
CS 354 Project 2 and Compression
Mark Kilgard
 
CS 354 Interaction
Mark Kilgard
 
Clustered defered and forward shading
WuBinbo
 
Lighting you up in Battlefield 3
Electronic Arts / DICE
 

What's hot (20)

PPT
Secrets of CryENGINE 3 Graphics Technology
Tiago Sousa
 
PDF
Siggraph2016 - The Devil is in the Details: idTech 666
Tiago Sousa
 
PPT
Stable SSAO in Battlefield 3 with Selective Temporal Filtering
Electronic Arts / DICE
 
PPT
The Unique Lighting of Mirror's Edge
Electronic Arts / DICE
 
PPTX
SIGGRAPH 2018 - Full Rays Ahead! From Raster to Real-Time Raytracing
Electronic Arts / DICE
 
PPTX
Shiny Pixels and Beyond: Real-Time Raytracing at SEED
Electronic Arts / DICE
 
PDF
Lighting Shading by John Hable
Naughty Dog
 
PPTX
More Performance! Five Rendering Ideas From Battlefield 3 and Need For Speed:...
Colin Barré-Brisebois
 
PPTX
Physically Based Sky, Atmosphere and Cloud Rendering in Frostbite
Electronic Arts / DICE
 
PPTX
Reyes
Dragan Okanovic
 
PPT
CS 354 Procedural Methods
Mark Kilgard
 
PDF
Graphics Gems from CryENGINE 3 (Siggraph 2013)
Tiago Sousa
 
PPT
Destruction Masking in Frostbite 2 using Volume Distance Fields
Electronic Arts / DICE
 
PPT
Crysis Next-Gen Effects (GDC 2008)
Tiago Sousa
 
PPT
Bending the Graphics Pipeline
Electronic Arts / DICE
 
PPTX
A Certain Slant of Light - Past, Present and Future Challenges of Global Illu...
Electronic Arts / DICE
 
PPTX
Physically Based and Unified Volumetric Rendering in Frostbite
Electronic Arts / DICE
 
PDF
The Technology of Uncharted: Drake’s Fortune
Naughty Dog
 
PPTX
Around the World in 80 Shaders
stevemcauley
 
PPTX
SIGGRAPH 2018 - PICA PICA and NVIDIA Turing
Electronic Arts / DICE
 
Secrets of CryENGINE 3 Graphics Technology
Tiago Sousa
 
Siggraph2016 - The Devil is in the Details: idTech 666
Tiago Sousa
 
Stable SSAO in Battlefield 3 with Selective Temporal Filtering
Electronic Arts / DICE
 
The Unique Lighting of Mirror's Edge
Electronic Arts / DICE
 
SIGGRAPH 2018 - Full Rays Ahead! From Raster to Real-Time Raytracing
Electronic Arts / DICE
 
Shiny Pixels and Beyond: Real-Time Raytracing at SEED
Electronic Arts / DICE
 
Lighting Shading by John Hable
Naughty Dog
 
More Performance! Five Rendering Ideas From Battlefield 3 and Need For Speed:...
Colin Barré-Brisebois
 
Physically Based Sky, Atmosphere and Cloud Rendering in Frostbite
Electronic Arts / DICE
 
CS 354 Procedural Methods
Mark Kilgard
 
Graphics Gems from CryENGINE 3 (Siggraph 2013)
Tiago Sousa
 
Destruction Masking in Frostbite 2 using Volume Distance Fields
Electronic Arts / DICE
 
Crysis Next-Gen Effects (GDC 2008)
Tiago Sousa
 
Bending the Graphics Pipeline
Electronic Arts / DICE
 
A Certain Slant of Light - Past, Present and Future Challenges of Global Illu...
Electronic Arts / DICE
 
Physically Based and Unified Volumetric Rendering in Frostbite
Electronic Arts / DICE
 
The Technology of Uncharted: Drake’s Fortune
Naughty Dog
 
Around the World in 80 Shaders
stevemcauley
 
SIGGRAPH 2018 - PICA PICA and NVIDIA Turing
Electronic Arts / DICE
 
Ad

Similar to The technology behind_the_elemental_demo_16x9-1248544805 (20)

PPTX
The Rendering Pipeline - Challenges & Next Steps
repii
 
PPTX
Five Rendering Ideas from Battlefield 3 & Need For Speed: The Run
Electronic Arts / DICE
 
PDF
Penner pre-integrated skin rendering (siggraph 2011 advances in real-time r...
JP Lee
 
PPTX
Unity AMD FSR - SIGGRAPH 2021.pptx
ssuser2c3c67
 
PPT
NVIDIA Graphics, Cg, and Transparency
Mark Kilgard
 
PPTX
Past, Present and Future Challenges of Global Illumination in Games
Colin Barré-Brisebois
 
PPTX
Stochastic Screen-Space Reflections
Electronic Arts / DICE
 
KEY
Colin Barre-Brisebois - GDC 2011 - Approximating Translucency for a Fast, Che...
Colin Barré-Brisebois
 
PPT
Frostbite Rendering Architecture and Real-time Procedural Shading & Texturing...
repii
 
PPTX
Next generation mobile gp us and rendering techniques - niklas smedberg
Mary Chan
 
PPT
Paris Master Class 2011 - 05 Post-Processing Pipeline
Wolfgang Engel
 
PPT
CS 354 GPU Architecture
Mark Kilgard
 
PDF
NVIDIA effects GDC09
IGDA_London
 
PDF
Rendering basics
icedmaster
 
PDF
Deferred Rendering in Killzone 2
ozlael ozlael
 
PDF
Deferred Rendering in Killzone 2
Guerrilla
 
PPTX
Real-time lightmap baking
Rosario Leonardi
 
PPTX
Lighting the City of Glass
Electronic Arts / DICE
 
PDF
Deferred Rendering in Killzone 2
Slide_N
 
PDF
Minko - Flash Conference #5
Minko3D
 
The Rendering Pipeline - Challenges & Next Steps
repii
 
Five Rendering Ideas from Battlefield 3 & Need For Speed: The Run
Electronic Arts / DICE
 
Penner pre-integrated skin rendering (siggraph 2011 advances in real-time r...
JP Lee
 
Unity AMD FSR - SIGGRAPH 2021.pptx
ssuser2c3c67
 
NVIDIA Graphics, Cg, and Transparency
Mark Kilgard
 
Past, Present and Future Challenges of Global Illumination in Games
Colin Barré-Brisebois
 
Stochastic Screen-Space Reflections
Electronic Arts / DICE
 
Colin Barre-Brisebois - GDC 2011 - Approximating Translucency for a Fast, Che...
Colin Barré-Brisebois
 
Frostbite Rendering Architecture and Real-time Procedural Shading & Texturing...
repii
 
Next generation mobile gp us and rendering techniques - niklas smedberg
Mary Chan
 
Paris Master Class 2011 - 05 Post-Processing Pipeline
Wolfgang Engel
 
CS 354 GPU Architecture
Mark Kilgard
 
NVIDIA effects GDC09
IGDA_London
 
Rendering basics
icedmaster
 
Deferred Rendering in Killzone 2
ozlael ozlael
 
Deferred Rendering in Killzone 2
Guerrilla
 
Real-time lightmap baking
Rosario Leonardi
 
Lighting the City of Glass
Electronic Arts / DICE
 
Deferred Rendering in Killzone 2
Slide_N
 
Minko - Flash Conference #5
Minko3D
 
Ad

More from mistercteam (17)

PPTX
Preliminary xsx die_fact_finding
mistercteam
 
PDF
20150207 howes-gpgpu8-dark secrets
mistercteam
 
PDF
S0333 gtc2012-gmac-programming-cuda
mistercteam
 
PDF
201210 howes-hsa and-the_modern_gpu
mistercteam
 
PPTX
3 673 (1)
mistercteam
 
PDF
3 boyd direct3_d12 (1)
mistercteam
 
PDF
5 baker oxide (1)
mistercteam
 
PDF
Lecture14
mistercteam
 
PDF
01 intro-bps-2011
mistercteam
 
PDF
Gdce 2010 dx11
mistercteam
 
PDF
Hpg2011 papers kazakov
mistercteam
 
PPSX
Dx11 performancereloaded
mistercteam
 
PDF
Mantle programming-guide-and-api-reference
mistercteam
 
PPSX
D3 d12 a-new-meaning-for-efficiency-and-performance
mistercteam
 
PPSX
D3 d12 a-new-meaning-for-efficiency-and-performance
mistercteam
 
PPSX
Advancements in-tiled-rendering
mistercteam
 
PPSX
Getting the-best-out-of-d3 d12
mistercteam
 
Preliminary xsx die_fact_finding
mistercteam
 
20150207 howes-gpgpu8-dark secrets
mistercteam
 
S0333 gtc2012-gmac-programming-cuda
mistercteam
 
201210 howes-hsa and-the_modern_gpu
mistercteam
 
3 673 (1)
mistercteam
 
3 boyd direct3_d12 (1)
mistercteam
 
5 baker oxide (1)
mistercteam
 
Lecture14
mistercteam
 
01 intro-bps-2011
mistercteam
 
Gdce 2010 dx11
mistercteam
 
Hpg2011 papers kazakov
mistercteam
 
Dx11 performancereloaded
mistercteam
 
Mantle programming-guide-and-api-reference
mistercteam
 
D3 d12 a-new-meaning-for-efficiency-and-performance
mistercteam
 
D3 d12 a-new-meaning-for-efficiency-and-performance
mistercteam
 
Advancements in-tiled-rendering
mistercteam
 
Getting the-best-out-of-d3 d12
mistercteam
 

Recently uploaded (20)

PPTX
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
PDF
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
PPTX
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
PDF
BLW VOCATIONAL TRAINING SUMMER INTERNSHIP REPORT
codernjn73
 
PDF
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
PDF
Advances in Ultra High Voltage (UHV) Transmission and Distribution Systems.pdf
Nabajyoti Banik
 
PDF
The Evolution of KM Roles (Presented at Knowledge Summit Dublin 2025)
Enterprise Knowledge
 
PDF
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
PDF
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
PDF
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
PPTX
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
PPTX
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
PDF
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
PDF
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
PDF
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
PPTX
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
PDF
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
PPTX
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PPTX
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
BLW VOCATIONAL TRAINING SUMMER INTERNSHIP REPORT
codernjn73
 
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
Advances in Ultra High Voltage (UHV) Transmission and Distribution Systems.pdf
Nabajyoti Banik
 
The Evolution of KM Roles (Presented at Knowledge Summit Dublin 2025)
Enterprise Knowledge
 
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 

The technology behind_the_elemental_demo_16x9-1248544805

  • 1. Advances in Real-Time Rendering in 3D Graphics and Games Course
  • 2. Advances in Real-Time Rendering in 3D Graphics and Games Course The Technology Behind the “Unreal Engine 4 Elemental demo” Advances in Real-Time Rendering in 3D Graphics and Games Course Martin Mittring Senior Graphics Architect [email protected] Epic Games, Inc.
  • 3. Advances in Real-Time Rendering in 3D Graphics and Games CourseOverview  Real-time Demo  Graphical Features  Indirect Lighting  Shading  Post Processing  Particles  Questions
  • 4. Advances in Real-Time Rendering in 3D Graphics and Games Course Elemental demo  GDC 2012 demo behind closed doors  Demonstrate and drive development of Unreal® Engine 4  NVIDIA® Kepler GK104 (GTX 680)  Direct3D® 11  No preprocessing  Real-time  30 fps  FXAA  1080p at 90%
  • 5. Advances in Real-Time Rendering in 3D Graphics and Games CourseReal-Time Demo
  • 6. Advances in Real-Time Rendering in 3D Graphics and Games Course Transition to Unreal Engine 4  Shrink  Removed rarely used features  Unify renderer interface using Direct3D 11 as guidance  Research  Samaritan demo (Direct3D 11, Deferred shading, Tessellation, …)  Elemental demo (Global Illumination, …)  Expand  Bigger changes (Derived Data cache, new Editor UI, …)
  • 7. Advances in Real-Time Rendering in 3D Graphics and Games Course Working on Unreal Engine 4  This caught our attention: Interactive Indirect Illumination and Ambient Occlusion Using Voxel Cone Tracing [Crassin11] More details: Beyond Programmable Shading Course Tuesday, 9 am - 12 pm
  • 8. Advances in Real-Time Rendering in 3D Graphics and Games CourseIndirect Lighting
  • 9. Advances in Real-Time Rendering in 3D Graphics and Games Course  Volume ray casting [Groeller05]  Start with some start bias  Content adaptive step size  Lookup radiance and occlusion  Accumulate light with occlusion  Stop if occluded or far enough  Cone trace  Mip level from local cone width  Progressively increasing step size Voxel Cone Tracing Concept Cone Voxel Data
  • 10. Advances in Real-Time Rendering in 3D Graphics and Games Course Using Voxel Cone Tracing for GI 1/2  Like “Ray-tracing into a simplified scene”  Diffuse GI:  Multiple directions depending on normal  Opening angle from cone count  Specular Reflections:  Direction from mirrored eye vector  Opening angle from Specular Power  Not as precise as ray-tracing but  Fractional geometry intersection  No noise  Level of detail
  • 11. Advances in Real-Time Rendering in 3D Graphics and Games Course Using Voxel Cone Tracing for GI 2/2  [Crassin11] can be further optimized / approximated  Lower Voxel Resolution  Gather instead of scatter in Voxel Lighting pass  Adaptive sampling, sample reuse  Additional Benefits  Shadowed IBL  Shadowed area lights from emissive materials VL enabledVL disabled
  • 12. Advances in Real-Time Rendering in 3D Graphics and Games Course Voxel Cone Tracing Challenges  Stepping through thin walls  Wide cones show artifacts but narrow cones are slow  Mip maps need to be direction dependent  Creating voxel data from triangle meshes  Run-time memory management  Efficient implementation on GPU hardware  Sparse data structures
  • 13. Advances in Real-Time Rendering in 3D Graphics and Games Course Sparse Voxel Octree  Mapping function allows locally higher resolution  World 3D position <=> Index and local 3D position  Fully maintained on GPU  Index to access render stage specific data  Per node/leaf data  2x2x2 voxel data (placed at octree node corners)  6x 3x3x3 voxel data (like 2x2x2 with additional border)
  • 14. Advances in Real-Time Rendering in 3D Graphics and Games Course Filter and Finalize Voxelization Diffuse Sampling Screen Space Voxel Space Specular Sampling Voxel Lighting Pipeline each frameon demand Lighting
  • 15. Advances in Real-Time Rendering in 3D Graphics and Games Course  Create voxel geometry data in a Region  Input: Octree, Triangle Mesh, Instance Data, Materials, Region  Output: Octree, 2x2x2 material attributes, normal  Region revoxelization  Geometry changes  Material changes  Resolution changes  Optimized for few dynamic objects  Revoxelize on demand  Region keeps static voxel data separate Voxelization 1/2 3D Scene Voxel resolution as color
  • 16. Advances in Real-Time Rendering in 3D Graphics and Games Course Voxelization 2/2  Pixel shader pass using hardware rasterizer  One rasterization pass per axis (X, Y, Z) to avoid holes  Shader evaluates artist defined material  Output: fragment queue that is processed by following CS  Compute Shader pass  Update octree data structures (in parallel)  Stores voxel data in leaves  2 Pass method  Better occupancy for second pass (2x2 quad)  Shader compile time (reuse CS)
  • 17. Advances in Real-Time Rendering in 3D Graphics and Games Course Voxel Lighting  Compute shading and store Radiance  Input: 2x2x2 material attributes, normal  Output: 2x2x2 HDR color and opacity  Accumulate Irradiance and Shade  Add direct light with shadow maps  Add ambient color  Combine with albedo color  Add emissive color 3D Scene Voxel Lighting Data
  • 18. Advances in Real-Time Rendering in 3D Graphics and Games Course  Generate mip-maps, Create redundant border, Compress  Input: 2x2x2 HDR color, occlusion and normal  Output: HDR multiplier, 6 x 3x3x3 LDR color and occlusion  Generate directionally dependent voxel  See view dependent voxels in [Gobbetti05]  At leaf level from voxel normal  At node level from same direction only Filter Voxels and Finalize Directionally independent Directionally dependent
  • 19. Advances in Real-Time Rendering in 3D Graphics and Games Course The Cone Trace function   Traverse tree to find node index and node local position  3 tri-linear filtered lookups in 32 bit volume texture to get 3 directions  Weight results based on direction (Ambient Cube [McTaggart04])   Calls SVOLookup() many times  Get all lighting coming from the given direction in a cone float4 HDRColorAndOcclusion = SVOLookupLevel (float3 Pos, int Mip, float3 Direction) float4 HDRColorAndOcclusion = SVOConeTrace (float3 Pos, float3 Direction, float ConeAngle)
  • 20. Advances in Real-Time Rendering in 3D Graphics and Games Course Specular Sampling 1/2  Per pixel local reflections  Cone angle from Specular Power  Single cone usually sufficient  Complex BRDF possible  Adaptive for better performance  Specular brightness  Depth difference  Normal difference Up-sample in X Scatter Specular Up-sample in Y Scatter Specular Specular Refinement Point Queue Half Res Full Res Refinement Point Queue
  • 21. Advances in Real-Time Rendering in 3D Graphics and Games Course  Up-sample pass using Dispatch()  Scatter passes use DispatchIndirect() Specular Sampling 2/2 uint Pos = 0; InterlockedAdd(State[STATE_Count], 1, Pos); InterlockedMax(State[STATE_ThreadGroupCountX], (Pos+63)/64); // saves one pass RWScratchColors[Pos] = (ThreadId.y << 16) | ThreadId.x; Half Res Adaptive ResultRefinement Point Queue Reference
  • 22. Advances in Real-Time Rendering in 3D Graphics and Games Course Diffuse Sampling 1/2  Similar to Final Gathering [Jensen02]  Problem:  Few samples for good performance  Enough samples for quality (cone angle)  Well distributed over hemisphere to reduce error  Don’t want noise  Don’t want to blur over normal details  Diffuse is mostly low frequency  Coherency important for efficiency
  • 23. Advances in Real-Time Rendering in 3D Graphics and Games Course  Non-interleaved processing of interleaved 3x3 pattern [Segovia06]  9 well distributed cones in world space  Loop over 9 directions, then XY  Reject samples behind surface normal  Output non interleaved  Compositing Pass:  Recombine non interleaved sub images  Weight by normal and depth  5x5 filter to account for missing samples  Multiply with Albedo color Diffuse Sampling 2/2 5 6 4 5 6 4 8 9 7 8 9 7 2 3 1 2 3 1 5 6 4 5 6 4 8 9 7 8 9 7 2 3 1 2 3 1 ………. ………. ………. ………. Interleaved Non Interleaved Samples on Sphere
  • 24. Advances in Real-Time Rendering in 3D Graphics and Games Course Voxel Lighting Examples 1/3 enableddisabled
  • 25. Advances in Real-Time Rendering in 3D Graphics and Games Course Voxel Lighting Examples 2/3
  • 26. Advances in Real-Time Rendering in 3D Graphics and Games Course Voxel Lighting Examples 3/3 enableddisabled
  • 27. Advances in Real-Time Rendering in 3D Graphics and Games CourseShading
  • 28. Advances in Real-Time Rendering in 3D Graphics and Games Course
  • 29. Advances in Real-Time Rendering in 3D Graphics and Games Course Deferred Shading Name Format Usage Depth D24 Depth Stencil S8 Stencil masking SceneColor R16G16B16A16f RGB: Emissive and Light Accumulation GBufferA R10G10B10A2 RGB: WS Normal, A: Lighting Model GBufferB R8G8B8A8 RGB: Specular, A: Ambient Occlusion GBufferC R8G8B8A8 RGB: Diffuse, A:Opacity or Decal Mask GBufferD R8G8B8A8 R: Specular Power*, GBA: Subsurface Color * not in alpha channel because of frame buffer blending limitations  Classic deferred shading in PS (one forward pass)
  • 30. Advances in Real-Time Rendering in 3D Graphics and Games Course New Specular Power Encoding NewEncode(x): (log2(Value) + 1) / 19 NewDecode(x): exp2(Value * 19 - 1) 1.0 0.0 OldEncode(x): sqrt(x / 500) OldDecode(x): x * x * 500 1.0 0.0  Higher Specular Power for IBL  More definition for common values  Tweaked to give pixel sharp reflection on a far sphere of width 1000 pixel Old New
  • 31. Advances in Real-Time Rendering in 3D Graphics and Games Course Gaussian Specular Dot = saturate(dot(N, H)) Threshold = 0.04 CosAngle = pow(Threshold, 1 / BlinnPhongSpecularPower) NormAngle = (Dot - 1) / (CosAngle – 1) LightSpecular = exp(- NormAngle * NormAngle) * Lambert GaussianPhong  Gaussian Specular for less aliasing [McKesson12]  Our empirical approximation
  • 32. Advances in Real-Time Rendering in 3D Graphics and Games Course Area Light Specular  Soft Sphere Area Light  Energy conserving (approximation) different radii LightAreaAngle = atan(AreaLightFraction / LightDistance) ACos = acos(CosAngle) CosAngle = cos(ACos + LightAreaAngle) SpecularLighting /= pow(ACos + LightAreaAngle, 2) * 10
  • 33. Advances in Real-Time Rendering in 3D Graphics and Games Course Specular Comparison Area Light + IBLPoint Light + IBL Area LightPoint Light
  • 34. Advances in Real-Time Rendering in 3D Graphics and Games CoursePost Processing
  • 35. Advances in Real-Time Rendering in 3D Graphics and Games Course New post processing graph  Graph:  Created each frame  No User Interface  Dependencies define execution order  RT on demand, ref. counting, lazy release  Node:  Many types but fixed function  Multiple inputs and outputs  Defines output texture format UpScale avg. 4 samples ToneMap HDR to LDR GaussianBlurX DownSample 4 to1 PostProcessAA FXAA TextureInput Scene Color GaussianBlurY Example Graph
  • 36. Advances in Real-Time Rendering in 3D Graphics and Games Course Screen Space Ambient Occlusion  Classic SSAO [Kajalin09]  Ambient occlusion computed as post process  Only requires z buffer and 3d point samples  Few samples are permutated with small screen aligned pattern  Our technique is based on 2d point samples  Angle based similar to HBAO [Sainz08]  Using GBuffer normal improves quality further  Complements Voxel Lighting with high frequency details
  • 37. Advances in Real-Time Rendering in 3D Graphics and Games Course  We use 6 sample pairs = 12 samples into half res z buffer  16 rotations with scale interleaved in 4x4 pattern SSAO sampling + = 6 Samples pairs 16 rotations with scale in 4x4 pixel block 192 samples in 4x4 pixel block
  • 38. Advances in Real-Time Rendering in 3D Graphics and Games Course SSAO with per pixel normal  Per pixel normal further restricts angle A B C D E A) Given: z buffer in the sample direction B) Get equi-distant z values from samples C) AO (so far) = min((angle_left+angle_right)/180,1) D) Clamp against per pixel normal E) AO (per pixel normal) = (angle_left+angle_right)/180 AO ~= 1-saturate(dot(VecA,Normal)/length(VecA))
  • 39. Advances in Real-Time Rendering in 3D Graphics and Games Course SSAO Example SSAO with per pixel NormalSSAO (Depth only)
  • 40. Advances in Real-Time Rendering in 3D Graphics and Games Course SSAO Example Close-up SSAO with per pixel NormalSSAO (Depth only)
  • 41. Advances in Real-Time Rendering in 3D Graphics and Games Course Image Based Lens Flares 1/2  Lens flares are out of focus reflections on the camera lens  Image based method  Threshold and blur bright image parts  Scale and mirror image multiple times  Soft mask screen borders  Lens/Bokeh Blur (for out of focus)  Render a textured sprite for each very bright low res pixel  Ideally for each lens reflection with different radius
  • 42. Advances in Real-Time Rendering in 3D Graphics and Games Course Source Image with Bloom Image Based Lens Flares 2/2 IB Lens Flares (without Lens Blur) IB Lens Flares (with Lens Blur)Lens Blur Sprite Image
  • 43. Advances in Real-Time Rendering in 3D Graphics and Games Course IB Lens Flares Examples Emissive (Sun) Emissive (Fire) Reflections
  • 44. Advances in Real-Time Rendering in 3D Graphics and Games Course HDR Histogram [Scheuermann07]  64 Buckets, logarithmic, no atomics  Pass 1: Generate screen local histograms (CS) in parallel  Pass 2: Combine all lines into one  64 Buckets are stored in 16 ARGB Clear groupshared histograms float[64][16] Sync Accumulate histograms in parallel Sync Accumulate many Histograms to one float4[16] Output one Histogram per line in 16 texels
  • 45. Advances in Real-Time Rendering in 3D Graphics and Games Course Eye Adaptation  Compute average brightness from Histogram (blue line)  Consider only bright areas (e.g. >90%)  Reject few very bright areas (very bright emissive, e.g. >98%)  Compute single multiplier for whole view port  Smoothly blend with last frame average (white bar)  Bound in user specified region (green)  Apply in tone mapper (white curve)  Read result in tone mapping VS  Pass to PS as interpolator
  • 46. Advances in Real-Time Rendering in 3D Graphics and Games CourseParticles
  • 47. Advances in Real-Time Rendering in 3D Graphics and Games Course GPU accelerated particles  CPU  Spawn particles (arbitrarily complex logic)  Memory management in fixed size buffers (unit: 16 particles)  Emitter management (Index buffer, draw call sorting)  GPU  Motion from Newtonian mechanics (fixed function)  Lighting from non directional volume cascades (3D lookups)  GPU Radix depth sort if required [Merrill11] [Satish09]  Rendering  Additional forces from Vector Fields* (3D lookup)  Particle Curves to modulate particle attributes* (1D lookup) * See next slides
  • 48. Advances in Real-Time Rendering in 3D Graphics and Games Course Particle Attributes  State-full simulation [Lutz04]  Allows more complex animations  Stored over particle lifetime  Particle Curves: Time Phase and Scale Name Format Usage Position R32G32B32A32f World Space Position*, Time Phase Velocity R16G16B16A16f World Space Velocity, Time Scale Render Attrib. R8G8B8A8 Size, Rotation Simulation Attrib. R8G8B8A8 Drag, Vector Field Scale, Random Seed
  • 49. Advances in Real-Time Rendering in 3D Graphics and Games Course  Concept  1D Function of time  Artist driven (arbitrary complex)  Implementation  Filtered texture lookup (Piecewise linear, equidistant)  Sample count depends on source curve (error threshold)  Many 1D curves packed into single 2D texture Particle Curves Name Format Usage Attributes R8G8B8A8 Modulate simulation or render attributes
  • 50. Advances in Real-Time Rendering in 3D Graphics and Games Course  Per volume attributes  World to Volume matrix  Force scale (accumulate)  Velocity scale (weighted blend)  Affect all particle systems globally or a single system  Per volume element attributes  Can be imported from Maya  Unified interface for many kind of complex motions Particle Vector Fields Name Format Usage OffsetVector R16G16B16A16f Force or Velocity Delta
  • 51. Advances in Real-Time Rendering in 3D Graphics and Games Course Shadow receiving Translucency
  • 52. Advances in Real-Time Rendering in 3D Graphics and Games Course Volumetric direct and indirect lighting
  • 53. Advances in Real-Time Rendering in 3D Graphics and Games Course > 1 Million Particles
  • 54. Advances in Real-Time Rendering in 3D Graphics and Games Course Thanks  NVIDIA, AMD  Special thanks to Cyril Crassin and Evan Hart from NVIDIA  Epic  Rendering team: Daniel Wright, Andrew Scheidecker, Nick Penwarden  Everyone that contributed to Unreal Engine 4
  • 55. Advances in Real-Time Rendering in 3D Graphics and Games Course
  • 56. Advances in Real-Time Rendering in 3D Graphics and Games CourseEpic Games is hiring  Work on leading game engine  Unreal Engine 3  Upcoming: Unreal Engine 4  Ship successful games  Gear Of War 1-3, Infinity Blade 1-2, …  Upcoming: Fortnite, Infinity Blade: Dungeons  Target many platforms:  Xbox 360, PlayStation 3, PC DX9/11, Mobile, Mac, next gen consoles  Main office in North Carolina www.EpicGames.com/jobs
  • 57. Advances in Real-Time Rendering in 3D Graphics and Games Course  [Crassin11] Interactive Indirect Illumination and Ambient Occlusion Using Voxel Cone Tracing Interactive Indirect Illumination Using Voxel Cone Tracing, Sep 2011 http://research.nvidia.com/sites/default/files/publications/GIVoxels-pg2011-authors.pdf  [Kawase04] Practical Implementation of High Dynamic Range Rendering http://www.daionet.gr.jp/~masa/archives/GDC2004/GDC2004_PIoHDRR_SHORT_EN.ppt  [Segovia06] Non-interleaved Deferred Shading of Interleaved Sample Patterns http://liris.cnrs.fr/Documents/Liris-2476.pdf  [Kajalin09] Screen Space Ambient Occlusion ShaderX7 - Advanced Rendering Techniques  [Sainz08] Image-Space Horizon-Based Ambient Occlusion http://www.nvidia.com/object/siggraph-2008-HBAO.html  [Tabellion08] Practical Global Illumination with Irradiance Caching http://cgg.mff.cuni.cz/~jaroslav/papers/2008-irradiance_caching_class/10-EricSlides.pdf  [Toksvig05] Mipmapping normal maps. Journal of Graphics Tools 10, 3, 65–71 ftp://download.nvidia.com/developer/Papers/Mipmapping_Normal_Maps.pdf  [Bruneton11] A Survey of Non-linear Pre-filtering Methods for Efficient and Accurate Surface Shading http://hal.inria.fr/docs/00/58/99/40/PDF/article.pdf  [McKesson12] Gaussian Specular from Learning Modern 3D Graphics Programming http://www.arcsynthesis.org/gltut/Illumination/Tut11%20Gaussian.html http://arcsynthesis.org/gltut/Illumination/Tut11%20On%20Performance.html  [Scheuermann07] Efficient Histogram Generation Using Scattering on GPUs http://developer.amd.com/gpu_assets/GPUHistogramGeneration_I3D07.pdf References 1/2
  • 58. Advances in Real-Time Rendering in 3D Graphics and Games Course  [Gobbetti05] Far Voxels: A Multiresolution Framework for Interactive Rendering of Huge Complex 3D Models on Commodity Graphics Platforms http://www.crs4.it/vic/cgi-bin/bib-page.cgi?id='Gobbetti:2005:FV‘  [Mittring11] The Technology Behind the DirectX 11 Unreal Engine "Samaritan" Demo http://udn.epicgames.com/Three/rsrc/Three/DirectX11Rendering/MartinM_GDC11_DX11_presentation.pdf  [Lutz04] Building a Million-Particle System http://www.gamasutra.com/view/feature/130535/building_a_millionparticle_system.php?page=1  [Lutz11] Everything about Particle Effects http://www.2ld.de/gdc2007  [McTaggart04] Half-Life®2 / Valve Source™ Shading http://www2.ati.com/developer/gdc/D3DTutorial10_Half-Life2_Shading.pdf  [Merrill11] High Performance and Scalable Radix Sorting Parallel Processing Letters, vol. 21, no. 2, 2011, pp. 245-272 https://sites.google.com/site/duanemerrill/awards-publications  [Satish09] Designing Efficient Sorting Algorithms for Manycore GPUs IPDPS '09: Proceedings of the 2009 IEEE International Symposium on Parallel & Distributed Processing, 2009 http://mgarland.org/files/papers/gpusort-ipdps09.pdf  [Jensen02] A Practical Guide to Global Illumination using Photon Mapping Siggraph 2002 http://www.cs.princeton.edu/courses/archive/fall02/cs526/papers/course43sig02.pdf  [Groeller05] A Simple and Flexible Volume Rendering Framework for Graphics-Hardware based Raycasting http://cumbia.informatik.uni-stuttgart.de/ger/research/pub/pub2005/vg2005-stegmaier.pdf References 2/2
  • 59. Advances in Real-Time Rendering in 3D Graphics and Games Course Questions?
  • 60. Advances in Real-Time Rendering in 3D Graphics and Games Course Bonus slides
  • 61. Advances in Real-Time Rendering in 3D Graphics and Games Course Bloom 1/2 [Kawase04]  Goal: Large, high quality, efficient  Down sample:  Blur during downsample avoids aliasing A = downsample2(FullRes) B = downsample2(A) C = downsample2(B) D = downsample2(C) E = downsample2(D) Without blur (1sample): With blur (4 samples):
  • 62. Advances in Real-Time Rendering in 3D Graphics and Games Course Bloom 2/2  Recombine (with increasing resolution):  Blurring while up sampling  Improves quality  Barely affects blur radius  Combine with dirt texture E’= blur(E,b5) D’= blur(D,b4)+E’ C’= blur(C,b3)+D’ B’= blur(B,b2)+C’ A’= blur(A,b1)+B’ blur(blur(X,a),b) ~= blur(X,max(a,b))
  • 63. Advances in Real-Time Rendering in 3D Graphics and Games Course Bloom Example Bloom with 5 Gaussians and DirtBloom with single Gaussian
  • 64. Advances in Real-Time Rendering in 3D Graphics and Games Course GBuffer Blur 1/2  Smart blur:  Average of 5 pixels  Weighted by normal  Weighted by depth difference  Applications:  Reduce aliasing of specular materials (noticeable in motion)  Reduce high frequency dither artifacts in Ambient Occlusion  Can increase performance of with IBL or Voxel Lighting
  • 65. Advances in Real-Time Rendering in 3D Graphics and Games Course GBuffer Blur 2/2  Using Gather() where possible (Depth, AO)  Output: SpecularPower, Normal, AmbientOcclusion  Reduce Specular Power [Toksvig05] [Bruneton11] L = saturate(length(SumNormal) * 1.002) SpecularPower *= L / (L + SpecularPower * (1 - L)) X Y ZW Kernel using 5 samples single Gather Kernel using 2 Gather
  • 66. Advances in Real-Time Rendering in 3D Graphics and Games Course without GBuffer Blur with GBuffer Blur
  • 67. Advances in Real-Time Rendering in 3D Graphics and Games Course SSS Material Example shadowedunshadowed
  • 68. Advances in Real-Time Rendering in 3D Graphics and Games Course Auxiliary to the graph  Post Process Volume:  Linearly blends Post process properties  Priority depending on camera position  Soft transitions with Blend Radius  Weight can be controlled remotely  Render Target Pool:  Allocation on demand, reference counting  Deferred release  Tools to look at intermediate Buffers
  • 69. Advances in Real-Time Rendering in 3D Graphics and Games Course Voxel Lighting Examples 3/5 enableddisabled
  • 70. Advances in Real-Time Rendering in 3D Graphics and Games Course
  • 71. Advances in Real-Time Rendering in 3D Graphics and Games Course Voxel Lighting Examples 5/5