Destiny Shader Pipeline

 



Abstract:
This talk delves into the shader pipeline that Bungie developed for Destiny, a fast-paced shared world shooter for PlayStation 4, PlayStation 3, Xbox One and Xbox 360.  This presentation will focus on the design, implementation, and lessons learned in building a flexible multiplatform shader pipeline from end to end.

The custom TFX shader system is at the heart of the Destiny shader pipeline.  The TFX language presents a unified interface for defining the relationship between content creators, client systems, and/or GPU state.  To the client engineer, it allows the creation of re-useable and interchangeable components that can encapsulate editable properties, HLSL shader code, and related GPU states.  Shader components can also specify expressions that link properties and engine runtime state to GPU state in a powerful yet performant manner.  The ability to tag components and their members with custom metadata is used to provide shader-specific intuitive user interface controls as well as serving as a method of querying the shaders from client import systems.  This ability was used extensively to drive efficient data preprocessing for performant runtime submission of drawcalls and as a mechanism for load-balancing multi-threaded renderer jobs execution. The metadata mechanism could also be leveraged for automatic selection of necessary vertex streams for memory and performance optimization, as well as selection of visibility properties based on shader markup such as alpha testing, and other.  

Destiny’s content-creator facing shader editor presents the artists with a flexible node graph interface, where each TFX component defines a node type that can be encapsulated and instantiated.  The node graphs support cross-file template references, allowing content creators to easily share arbitrary values, nodes, or sub-graphs from other files.  It also supports the concept of variant layers, which enable artists to specify multi-axis variations of the shader within a single file (i.e. different detail textures for different destination palettes, or different tint colors for various combatant factions).

Destiny’s integrated visual function editor gives content creators the ability to author animated or dynamic expressions visually, using any combination of available game and/or object state as input.  This functionality drove the power of Destiny’s expressive effects system. Both the TFX language expressions and the authored function expressions are compiled at import time into a bytecode representation that is interpreted on the CPU (or GPU) at runtime.  This function editor/dynamic expression system was generalized for use across the entire engine, in any case where a content-authored dynamic function of game state was desired.  This talk will analyze the benefits of such powerful representation within the context of the shipping Destiny games, as well as some of the challenges this interpreted bytecode system presented for our development.

Destiny’s TFX system allowed client engineers to define custom scopes: a subset of GPU state that is controlled outside of the primary shader directly in native engine code layers.  This mechanism enables inner or outer loop optimizations for state that can be submit at a different frequency from the primary shader.  We leveraged this mechanism for decoupling offline precompiled shaders from patchable shader ‘packages’ to comprise the heart of Destiny’s gear customization system, using custom shaders scopes to define and distribute gear material representations.  The talk will discuss performance characteristics of this scope driven shader system, and a runtime lightweight validation system which ensures correct submission of GPU state with no invalid or conflicting set of active scopes provided by the runtime engine.

This talk will postmortem the strengths of the Destiny shader system, as well as delve into some of the challenges that we encountered during the games’ development, including challenges with managing the vast shader permutation matrix resulted from our flexible shader variant system, which encouraged artists to make hundreds or thousands of possible permutations. We will discuss some of the solutions we are undertaking to improve our shading system further based on the lessons we learned during the first several releases of Destiny.

We believe that the details of our approach, the successes and challenges encountered, and lessons learned will benefit anyone working on a modern multi-platform renderer for their own games.

Presenters: Natalya Tatarchuk, Chris Tchou

Bios:

Natalya Tatarchuk (@mirror2mask) is a graphics engineer and a rendering enthusiast. As the Director of Global Graphics at Unity Technologies, she is focusing on driving the state-of-the-art rendering technology and graphics performance for the Unity engine. Previously she was the Graphics Lead and an Engineering Architect at Bungie, working on innovative cross-platform rendering engine and game graphics for Bungie’s Destiny franchise, including leading graphics on the upcoming Destiny 2 title. Natalya also contributed graphics engineering to the Halo series, such as Halo: ODST and Halo:Reach. Before moving into game development full-time, Natalya was a graphics software architect and a lead in the Game Computing Application Group at AMD Graphics Products Group (Office of the CTO) where she pushed parallel computing boundaries investigating advanced real-time graphics techniques. Natalya has been encouraging sharing in the games graphics community for several decades, largely by organizing a popular series of courses such as Advances in Real-time Rendering and the Open Problems in Real-Time Rendering at SIGGRAPH. She has also published papers and articles at various computer graphics conferences and technical book series, and has presented her work at graphics and game developer conferences worldwide. Natalya is a member of multiple industry and hardware advisory boards. She holds an M.S. in Computer Science from Harvard University with a focus in Computer Graphics and B.A. degrees in Mathematics and Computer Science from Boston University.

 

Chris Tchou is a Graphics Lead at Unity Technologies where he’s focusing on state of the art rendering techniques for Unity rendering. Previously Chris was an Engineering Lead at Bungie, where he has worked on the graphics engine for every Bungie title since Halo 3.  Previously, he was a Research Engineer in the Graphics Lab at USC’s Institute for Creative Technologies, where he investigated high dynamic range imaging and surface material scanning, published a number of articles and papers in computer graphics conferences, and was the primary author of HDR Shop.  Chris holds an MS in Computer Science from UC Berkeley, and a BS in Computer Science and Mathematics from Carnegie Mellon University.

Materials: (Updated: August 14th, 2017)

PDF (24 MB), video 1 (slide 103), video 2 (slide 119), video 3 (slide 122), video 4 (slide 259), video 5 (slide 263)

 

 

 

 

Contact: