Low-level Shader Optimization for Next-Gen and DX11 Emil Persson Head of Research, Avalanche Studios
[UniteKorea2013] Butterfly Effect DX11
-
Upload
unity-technologies-korea -
Category
Technology
-
view
887 -
download
1
description
Transcript of [UniteKorea2013] Butterfly Effect DX11
Butterfly E!ect DirectX 11 graphic featuresErland Körner, Technical Artist, Unity Sweden
Apr 12, 2013 Page
Who am I?!• I am Erland Körner
• Unity Stockholm, Sweden
• Graphic Artist on demo-team
• 2 decades AAA background. EA/DICE - Battlefield and Mirrors Edge.
2
Apr 12, 2013 Page
Unity DirectX11
Butterfly E!ect
3
Apr 12, 2013 Page
Unity DirectX11
Summed up• Realtime shortfilm using Unity.
Research project.
• Unity, Passion Pictures and Nvidia.
• ˜25 CG Artists (0 Unity experience), ˜5 Programmers during 14 weeks production time.
• 40GB Data, 40 scenes, 130 shots. Using Unity CacheServer.
• DirectX 11 and 64bit Editor.
4
Apr 12, 2013 Page
Unity DirectX11
Usages in Butterfly e!ect
• DX11 = Collection of Windows multimedia API’s for games. Available in Unity 4.x.
• DirectX 11 broadens visual (GPU) scope and fidelity. Eases e!orts.
• Compute shaders, Tessellation and 3D Textures
• Enabling us to have Physically based, energy conservative shaders on environment, skin and eyes
• ...Hair rendering and tessellation
• ...Full screen Post Processing
• ...Volumetric explosions
5
Apr 12, 2013 Page
Unity DirectX11
Compute shader example 1• +1 million particles in Unity
• Fully simulated on the GPU, hardly no pressure on CPU.
• GPU bu!er position and velocity.
• Each particle is a generated billboard.
6
Apr 12, 2013 Page
Unity DirectX11
Compute shader example 2• Fluid simulation.
• Works on 3D textures and performs simulation.
• Texture describes the density and velocity.
• To show the result the density 3D texture is raymarched.
• A gradient texture is also sampled to provide di!erent color depending on volume thickness.
7
Apr 12, 2013 Page
Unity DirectX11
Physically based shaders• Inspired by Mental Ray
“Architectural” (MIA) shader
• High quality o"ine rendering
• Suitable for hard-surface materials
• Familiar and intuitive to CG / non-game artists.
• THE shader for everything!!!
• Energy conserving - Material follows laws of physics!
8
Apr 12, 2013 Page
Unity DirectX11
Skin Rendering• Physically based shading.
• Mimics o"ine SSS rendering tools. Top, epidermis and subdermal skin layers.
• Renders lighting, then blurs, combines, and adds top- and 2 spec layers.
• Back scatter, based on translucency layers. Adds intensities into sublayer. Indirect light from spherical harmonics.
• Catmull-Clark Subdivision, not directly Dx11 tessellation.
9
Apr 12, 2013 Page
Unity DirectX11
Hair and Tessellation• System designed to be similar
to o"ine systems.
• Geometry shader. Rendered using DirectX 11 tessellation.
• Hardware hair geometry generation.
• Hair defined by Emitter mesh and Guide hairs in 3d package.
10
Apr 12, 2013 Page
Unity DirectX11
Filmic Post-E!ects breakdown• Heavy amounts of Post-
processing in every shot!
• ...Motionblur (Velocity blur)
• ...Depth Of Field and Bokeh shapes
• ...Photographic tonemapping
• ...Bloom (HDR, Specular highlights and sun reflections)
11
Apr 12, 2013 Page
Unity DirectX11
Filmic Post-E!ects breakdown• ...Color correction (3D LUT)
• ...RGB channel Noise and grain
• ...Lens distortion
• ..HBAO (Horizon Based Ambient Occlusion)
• Some already added to Unity 4.1...
12
Apr 12, 2013 Page
Unity DirectX11
Volumetric Explosions• Fluid simulation expensive and
hard to control.
• Procedural techniques are practical on current-gen hardware.
• Fast render volume renderer.
• Can calculate normal as gradient of distance field, for lighting. Gives AO approximations.
• Detail added by o!set with “pyroclastic” (Perlin) noise. Shade based on displacement amount.
13
Apr 12, 2013 Page
Thanks and credits
• Renaldas Zioma, Aras Pranckevičius, Ole Ciliox, Paulius Liekis, Stefan Sandberg at Unity
• Simon Green, Jon Jansen an everyone involved of Nvidia
• Passion Pictures
14
More examples
Apr 12, 2013 Page
Unity DirectX11
Opacity Mapping example• Fourier Opacity Mapping, for
rendering self-shadowing e!ects.
• DX11 Tessellation, for acceleration.
16
Apr 12, 2013 Page
Signed Distance Field example 1• Similar approach as volumetric
explosions.
• Julia fractal. Distance Fields are surfaces defined mathematically.
• For each pixel touched is raymarched a function that describes the fractal.
• Cubemap and AO sampled with the normal for added detail.
17
Apr 12, 2013 Page
Signed Distance Field example 2
• Describes whether camera is on the surface (value 0) or above or below it.
• Morphed by other functions, like the wave (sin and cos).
18
Apr 12, 2013 Page
Signed Distance Field example 3• Sample until reaching back of
the volume to figure out thickness.
• Dim surface where the volume is thicker.
19