Ritual ™ Entertainment: Next-Gen Effects on Direct3D ® 10 Sam Z. Glassenberg Program Manager Microsoft ® – Direct3D ® Doug Service Director of Technology Development Ritual™ Entertainment
Overview Crash Course in Direct3D 10 …What’s a Geometry Shader? Ritual: Targeting Direct3D 10
Direct3D 10: Design Imperatives Consistency (like a console) Guaranteed base feature set for you to target no ‘caps’ Strictly-defined behavior across all chipsets Performance Dramatically improved small-batch performance by design Offload the CPU with a more powerful geometry engine Visual Effects Increased flexibility and programmability New hardware capabilities
Overview: The New Hardware Pipeline Texture Arrays Geometry Shader Stream Output Resource Views Input Assembler Common Shader Core (SM 4.0) Integer/Bitwise Instructions Comparison Filtering Constant Buffers State Objects New compressed formats for HDR, normal/bump map content More textures, RT’s, instructions, registers, interstage communication Predicated Rendering Alpha-to-Coverage Multisample Readback …
Overview: The New Software Stack Streamlined and Layered Runtime Clean and Consistent API Robust debugging layers Lean’n’mean core New HLSL Compiler w/ New Language Features New Effects System Built upon the new Windows Vista ™ Display Driver Model
New Resource Types Texture1D/2D Array Dynamically Indexable in the Shader
New Resource Types Texture1D/2D Array Dynamically Indexable in the Shader Bind-able as Render Targets Each RenderTarget/DepthStencil can be a Render Target Array
Ubiquity of Resource Access Resource Views Example: Cubemap Views enable interpretation of resources at different bind locations
Ubiquity of Resource Access Resource Views Example: Cubemap
Views enable format re-interpretation of resource data Ubiquity of Resource Access Resource Views Example: Cubemap
Resource Views: Applications Depth/Stencil Readback Render-To-Cubemap Render-To-Volume Render-To-Buffer Render-To-Bitfield Render-To-Mipslice Custom Data Packing/Unpacking LOD Clamping
The Old Pipeline Direct3D 9 and Direct3D 9-based Platforms One Vertex In One Vertex Out
The Old Pipeline Direct3D 9 and Direct3D 9-based Platforms
The New Pipeline Direct3D10 – Geometry Shader Access to the whole primitive Triangle Line Point With adjacency
The New Pipeline Direct3D10 – Geometry Shader Usages All-GPU Material Systems Per-Primitive material selection & setup Compute edge lengths and wrinkle models Compute plane equations Compute silhouette edges Set up barycentrics to exceed # of interpolators
Geometry Shader Amplification and De-Amplification Emits primitives of a specified output type (point, linestrip, trianglestrip) Limited geometry amplification/de- amplification: Output values per invocation No more 1 in / 1 out limit! Shadow Volumes/Fur/Fins Procedural Geometry/Detailing All-GPU Particle Systems Point Sprites
Geometry Shader Amplification and De-Amplification Emits primitives of a specified output type (point, linestrip, trianglestrip) Limited geometry amplification/de- amplification: Output values per invocation No more 1 in / 1 out limit! Shadow Volumes/Fur/Fins Procedural Geometry/Detailing All-GPU Particle Systems Point Sprites
Geometry Shader System-Interpreted Values GS Can Emit a System-Interpreted Value: RenderTargetArrayIndex for the primitive Choose a slice for render-to-volume Choose a face for render-to-cubemap MRT still specified in the PS RenderTargetArrayIndex = 0
Geometry Shader System-Interpreted Values GS Can Emit a System-Interpreted Value: RenderTargetArrayIndex for the primitive Choose a slice for render-to-volume Choose a face for render-to-cubemap MRT still specified in the PS RenderTargetArrayIndex = 2
Stream Output Streams VS/GS results to one or more buffers in memory DrawAuto() to draw dynamic amounts of GS data without App/CPU intervention Uses: Iterative/procedural geometry processing All-GPU particle systems …… DrawAuto()