GDC2012 Mastering DirectX11 With Unity
GDC2012 Mastering DirectX11 With Unity
with Unity
Renaldas Zioma
Simon Green
Compute shader
Tessellation
3D textures
other technologies from 2002 that we added: single channel float
textures!
As an inspiration we have picked MR Architectural shader library - mainly because of familiarity to CG artists, wide range of
supported materials while keeping code kernel small and simple and energy conserving.
Our shaders primarily attempts to be physically accurate by keeping the track of the light distribution - light is either
absorbed, reflected or transmitted further, hence no light magically (dis)appears.
Unity Physically Based shader
Diffuse: Oren-Nayar
1 parameter: roughness
Lambert (roughness == 0)
different approximations
Specular: Cook-Torrance
2 parameters: roughness (glosiness), reflectivity
energy conserving
physically based
micro-facet theory
Adding more reflectivity (as energy must be taken from somewhere) the diffuse level and the transparency will be reduced
automatically. Adding transparency will reduce diffuse level.
Energy conservation applies to specular highlight of CookTorrance making intense highlights narrow and wide highlights less
intense. Analogous behavior is achieved with modified energy conserving BlinnPhong.
Reflectivity takes energy from Diffuse and
Transparency
Adding reflectivity will reduce diffuse energy
Transparency
Reflectivity
Multiple jittered samples could be used to improve quality of the blurry reflections beyond box filtering.
Combining 2 normal maps
In our case the initial mesh is already quite dense to support animation, and after one level of Catmull-Clark subdivision
the shape is close to the limit surface.
Global Illumination
APEX Destruction
Hair pipeline
Volumetric explosions
Motion blur
Turbulence
Vegetation
Clothing
Destruction
Extendible framework: the building blocks are modules that solve certain problems. Their runtime complexity varies, but a common to all is attention to
ease of authoring. Apex is artist-focused.
Many modules are currently available, or will be soon. Destruction and Clothing are ready now, in our 0.9 release, as well as particles and forcefields.
Vegetation (which integrates with SpeedTree) and Turbulence will be available soon.
APEX Destruction
Mesh data & Fracture Map
PhysXLab Core
Destruction
APEX Core
Renderer PhysX SDK
APX
Destruction is authored in PhysXLab. PhysXLab is a standalone tool that allows artists to fracture arbitrary objects and immediately try them
out within the tool.
You can import for example meshes from Alias OBJ or Autodesk FBX format files, then fracture it using a variety of methods. The result is
stored in an Destructible Asset file (pda). This includes the fractured graphics mesh as well as references to resources such as materials and
particle systems.
The tool allows you to select the internal material, used for the newly-generated internal faces.
What you see is what you get the APEX file output is used for simulation preview within the tool, as well as the runtime loadable asset.
Theres no difference.
APEX Destruction Demo
Hair and fur is the next big challenge for game characters
as animation and skin shading gets better, low quality hair more obvious
Unity hair system was designed to be similar as possible to off-
line systems
Hair styles (groom) can be modeled in Softimage XSI / Maya / MAX
Exported to Unity using PC2 point cache format
Rendered using DirectX 11 tessellation
Generation of render hair geometry done entirely in hardware
Geometry amplification
GeForce GTX 580 tessellation hardware is very fast
Particle system
Can look good, especially with pre-rendered sprites
But hard to get fireball look
Sprites can look flat, especially with a moving camera
Fluid simulation
Possible in DirectX 11, but expensive
Hard for artists to control
Procedural techniques
Practical on todays PC hardware
Advantages
Can render very quickly using sphere tracing
ray marching using distance information to take larger steps
Can calculate normal as gradient of distance field
Nice ambient occlusion approximations
Nice editor
Very customizable
Very fast to prototype new effects
Automatically generates sliders for shader parameters
Shader parameters can be animated over time using curves
C# is fine once you get used to it!
like Java without the stupid bits
Helpful developers and community