Epic Directx 11 Nvidia Samaritian Demo
Epic Directx 11 Nvidia Samaritian Demo
Bryan Dudash
Overview
About Real-time demo
Technical Part:
Tessellation (NVIDIA) Hair Deferred + MSAA Subsurface Scattering Reflections Depth of Field
Demo Goals
Ready for GDC 2011 Real-time on High-end PC (off the shelf hardware) Engine improvements:
Add Direct3D 11 support in Unreal Engine 3 Implement features needed for next-gen quality
Research:
New hardware features like Tessellation Advanced render techniques Content creation / workflow
3
Coat
Realistic and Interactive Clothing in Epic Games Samaritan Demo Using NVIDIA APEX Thursday 4:30- 5:30 Room 110, North Hall
6
Rendering
Tessellation Hair Deferred + MSAA Subsurface Scattering Reflections Depth of Field
Rendering
Tessellation Hair Deferred + MSAA Subsurface Scattering Reflections Depth of Field
Before VS
After VS
10
Hair creation
Generate very thin triangle strips in 3ds Max (Plug-in Hair Farm) ~5000 splines -> ~16000 triangles Texture contains 36 individual hairs
Texture
11
Rendering hair
How to shade the pixel?
Alpha Test / clip -> Problems with Aliasing Alpha Blend -> Problems with Sorting, fogging, Depth of Field Alpha To Coverage (A2C) -> Problems with many layers Order Independent Transparency [Gruen10] -> Too many layers?
Our choice:
Render to MSAA buffer -> Depth for DOF/Fog/Shadow receiving Stick to binary occlusion (per MSAA sample) SSAA (Alpha Test per MSAA sample) -> Anti-aliasing for individual hairs
12
SSAA
Rendering
Tessellation Hair Deferred + MSAA Subsurface Scattering Reflections Depth of Field
14
Anti-Aliasing
4x MSAA for forward rendering Deferred rendering requires special attention Per fragment shading only where needed:
1. 2. Clear stencil, Set stencil write Pass 1:
if heuristic(depth/normal) do discard otherwise shade per pixel
3. 4.
16
Rendering
Tessellation Hair Deferred + MSAA Subsurface Scattering Reflections Depth of Field
17
No SSS
SSS only
With SSS
18
16 samples
Rendering
Hair Deferred + MSAA Subsurface Scattering Reflections Depth of Field
20
21
Cubemaps
Planar reflection
[Buerger07]
fixed camera position fixed reflection plane good for dynamic ground reflection
Billboard reflections
Many textured quads (billboards) Placement like any other static object Can move/rotate/scale dynamically No limitations on the reflecting surface
22
Glossy reflections
Isotropic reflections
24
25
Reflection Shadows
Without shadows With shadows
26
27
Without
With
28
29
Rendering
Tessellation Hair Deferred + MSAA Subsurface Scattering Reflections Depth of Field
30
What is Bokeh?
Bokeh is the name of the shape that can be seen in photos or movies when objects are out of focus. Contributes to the filmic look Shape depends on the camera and lens Many Depth of Field algorithms blur objects out of focus without the desired shape. [Lefohn10]
Photo Reference Different Bokeh shapes (real-time)
31
Foreground (blurred)
Background (blurred)
32
1 2
Render Target with two viewports
33
Resolve pass:
Reconstruct the layer color (RGB divided by A) Blend layers by the accumulated occlusion (background, in focus, foreground)
Fill rate:
Input image is the half resolution scene (Color + Depth) Output image is half resolution and recombined later with full resolution For each 2x2 input block: depending on heuristic (CoC radius, color and depth difference), spawn 1 or 4 quads (GS)
34
35
References 1/2
[Buerger07] GPU Rendering of Secondary Effects http://wwwcg.in.tum.de/Research/data/Publications/vmv07.pdf [Tariq08] Real-Time Hair Rendering on the GPU http://developer.nvidia.com/object/siggraph-2008-hair.html [Lauritzen10] Deferred Rendering for Current and Future Rendering Pipelines http://visual-computing.intel-research.net/art/publications/deferred_rendering/ [CodeItNow09] Energy Conservation In Games http://www.rorydriscoll.com/2009/01/25/energy-conservation-in-games [Lefohn10] Advanced Real-Time Depth of Field Techniques https://graphics.stanford.edu/wikis/cs448s10/FrontPage?action=AttachFile&do=get&target=CS448s-10-10-depthOfFieldForWeb.pdf [Jimenez09] Screen-Space Perceptual Rendering of Human Skin http://giga.cps.unizar.es/~diegog/ficheros/pdf_papers/TAP_Jimenez_LR.pdf [Shopf09] Mixed Resolution Rendering http://developer.amd.com/gpu_assets/ShopfMixedResolutionRendering.pdf [Tomasi98] Bilateral Filtering for Gray and Color Images http://www.cs.duke.edu/~tomasi/papers/tomasi/tomasiIccv98.pdf [Hargreaves] Deferred Shading http://read.pudn.com/downloads160/sourcecode/game/724029/DeferredShading.pdf
36 /35
References 2/2
[Gruen10] OIT and Indirect Illumination using DX11 Linked Lists http://developer.amd.com/gpu_assets/OIT%20and%20Indirect%20Illumination%20using%20DX11 %20Linked%20Lists_forweb.ppsx Robust Multiple Specular Reflections and Refractions http://http.developer.nvidia.com/GPUGems3/gpugems3_ch17.html [Neulander01] Hair Rendering (Ivan Neulander, Rhythm & Hues Studios) http://www.rhythm.com/~ivan/hairRender.html [Nguyen06] GPU Gems2: Chapter 23. Hair Animation and Rendering in the Nalu Demo http://http.developer.nvidia.com/GPUGems2/gpugems2_chapter23.html [Assarson09] Siggraph 2009: GPU Primitives-Case Study: Hair Rendering http://s09.idav.ucdavis.edu/talks/07-Ulf-GPU-Prims-and-Hair-course-slides.pdf [Neulander98] Rendering Generalized Cylinders with Paintstrokes http://www.rhythm.com/~ivan/pdfs/gi98.pdf [LostPlanetD3D10] Lost Planet D3D10 Parallel Rendering http://meshula.net/wordpress/?p=124 [3DMark] 3DMark11 Whitepaper http://www.3dmark.com/wp-content/uploads/2010/12/3DMark11_Whitepaper.pdf [Buerger07] GPU Rendering of Secondary Effects http://wwwcg.in.tum.de/Research/data/Publications/vmv07.pdf [Mikkelsen10] Cross Bilateral Filters for Skin Shading http://jbit.net/~sparky/subsurf/cbf_skin.pdf
37
Thanks
Our partner: NVIDIA NVIDIA:
Johnny Costello, Bryan Dudash, Jon Jansen, Ignacio Llamas, John McDonald, David Schoemehl
38
Questions?
Is this a game?
No. This is just a technology demo.
Is that in UnrealEngine 3?
These features are available now to UE3 licensees and will be in the March UDK.
Realistic and Interactive Clothing in Epic Games Samaritan Demo Using NVIDIA APEX Thursday 4:30- 5:30 Room 110, North Hall
Bonus Slide
Barely documented but very useful:
HLSL Semantic SV_SampleIndex Used as input causes the shader to run per MSAA sample. Can be used in texture.Load(float2(u,v),SampleIndex) or EvaluateAttributeAtSample(Interpolator,SampleIndex) HLSL Semantic SV_Coverage uint, MSAA bit mask, PS input and output
Energy preserving 42