ritual ™ entertainment: next-gen effects on direct3d ® 10 sam z. glassenberg program manager...
TRANSCRIPT
Ritual™ Entertainment: Next-Gen Effects on Direct3D® 10
Sam Z. GlassenbergProgram ManagerMicrosoft® – Direct3D®
Doug ServiceDirector 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 TypesTexture1D/2D Array
Dynamically Indexable in the Shader
Common Shader Core
New Resource TypesTexture1D/2D Array
Dynamically Indexable in the Shader Bind-able as Render Targets
Each RenderTarget/DepthStencil can be a Render Target Array
Depth/Stencil RenderTarget0 RenderTarget1 RenderTarget2 RenderTarget3 RenderTarget4
Ubiquity of Resource AccessResource Views Example: Cubemap
Base Resource000100101001010101000001001011001010101000110010010100101010100000100101001010101100010011101001010101000001110111011010010101010000010010100101010100000111110011011100101010100000100110100101010100101010000010101010010101010000010011010010101010000101001110100101010100000111011101101001001010101000001001101001010101000010100111010010101010000011101110110100101010100000100101001010101000001001101001010101000001001101001010111010010101000001010101001010101100000100101001010101000001001110100101010100000111011101101001010101000001001010010101010000010011010010101010010101010000010011010010101010000101001110100101010100000111011101101001010101000001001010010101010000010011010010101010000010011010010101110100101010000010101010010101011000001001010010101010000010011101001010101000001110111011010010101010000010010100101010100000100110100101010100000100110100101010100101010000010101010010101010000010010111001010101000001001110100101010100000111011101101001010101000001001010010101010000010011010010101010000010011010010101010010000010011010010101010010101000001010101001010101000001001011100101010100000100111010010101010000011101110110100101010100000100101001010101000001001101001010101000001001101001010101001010101000001001010010101010000010011010010101010000010011010010101110100101010000010101010010101011000001001010010101010000010011101001010101000001110111011010010101010000010010100101010100000100110100101010100000100110100101010100101010000010101010010101010000010010111001010101000001001110100101010100000111011101101001010101000001001010010101010000010011
0100101010100000100110100101010100
Shader Resource View
Views enable interpretation of resources at different bind locations
Common Shader Core
Base Resource000100101001010101000001001011001010101000110010010100101010100000100101001010101100010011101001010101000001110111011010010101010000010010100101010100000111110011011100101010100000100110100101010100101010000010101010010101010000010011010010101010000101001110100101010100000111011101101001001010101000001001101001010101000010100111010010101010000011101110110100101010100000100101001010101000001001101001010101000001001101001010111010010101000001010101001010101100000100101001010101000001001110100101010100000111011101101001010101000001001010010101010000010011010010101010010101010000010011010010101010000101001110100101010100000111011101101001010101000001001010010101010000010011010010101010000010011010010101110100101010000010101010010101011000001001010010101010000010011101001010101000001110111011010010101010000010010100101010100000100110100101010100000100110100101010100101010000010101010010101010000010010111001010101000001001110100101010100000111011101101001010101000001001010010101010000010011010010101010000010011010010101010010000010011010010101010010101000001010101001010101000001001011100101010100000100111010010101010000011101110110100101010100000100101001010101000001001101001010101000001001101001010101001010101000001001010010101010000010011010010101010000010011010010101110100101010000010101010010101011000001001010010101010000010011101001010101000001110111011010010101010000010010100101010100000100110100101010100000100110100101010100101010000010101010010101010000010010111001010101000001001110100101010100000111011101101001010101000001001010010101010000010011
0100101010100000100110100101010100
Render Target View
Views enable interpretation of resources at different bind locations
Ubiquity of Resource AccessResource Views Example: Cubemap
Base Resource000100101001010101000001001011001010101000110010010100101010100000100101001010101100010011101001010101000001110111011010010101010000010010100101010100000111110011011100101010100000100110100101010100101010000010101010010101010000010011010010101010000101001110100101010100000111011101101001001010101000001001101001010101000010100111010010101010000011101110110100101010100000100101001010101000001001101001010101000001001101001010111010010101000001010101001010101100000100101001010101000001001110100101010100000111011101101001010101000001001010010101010000010011010010101010010101010000010011010010101010000101001110100101010100000111011101101001010101000001001010010101010000010011010010101010000010011010010101110100101010000010101010010101011000001001010010101010000010011101001010101000001110111011010010101010000010010100101010100000100110100101010100000100110100101010100101010000010101010010101010000010010111001010101000001001110100101010100000111011101101001010101000001001010010101010000010011010010101010000010011010010101010010000010011010010101010010101000001010101001010101000001001011100101010100000100111010010101010000011101110110100101010100000100101001010101000001001101001010101000001001101001010101001010101000001001010010101010000010011010010101010000010011010010101110100101010000010101010010101011000001001010010101010000010011101001010101000001110111011010010101010000010010100101010100000100110100101010100000100110100101010100101010000010101010010101010000010010111001010101000001001110100101010100000111011101101001010101000001001010010101010000010011
0100101010100000100110100101010100
Views enable format re-interpretation of resource data
R32_TYPELESS01001011101000101100011010010100
R32_FLOAT
R32_UINT
R32_SINT
Ubiquity of Resource AccessResource 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 PipelineDirect3D 9 and Direct3D 9-based Platforms
Vertex Shader
One Vertex In
One Vertex Out
Primitive Setup
Vertex Shader
Vertex Shader Pixel Shader
Vertex Shader
Vertex Shader
The Old PipelineDirect3D 9 and Direct3D 9-based Platforms
Primitive SetupVertex Shader Pixel Shader
The Old PipelineDirect3D 9 and Direct3D 9-based Platforms
Primitive SetupVertex Shader Pixel Shader
Pixel ShaderPixel ShaderPixel ShaderPixel ShaderPixel ShaderPixel ShaderPixel Shader
Vertex Shader
The Old PipelineDirect3D 9 and Direct3D 9-based Platforms
Primitive SetupVertex Shader Pixel Shader
The Old PipelineDirect3D 9 and Direct3D 9-based Platforms
Primitive SetupVertex Shader Pixel Shader
The Old PipelineDirect3D 9 and Direct3D 9-based Platforms
Geometry Shader
The New PipelineDirect3D10 – Geometry Shader
Vertex Shader Pixel Shader
Access to the whole primitive Triangle Line Point
With adjacency
Geometry Shader
The New PipelineDirect3D10 – Geometry Shader Usages
Vertex Shader Pixel Shader
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
interpolatorsGeometry Shader
Geometry Shader
Geometry ShaderAmplification and De-Amplification
Vertex Shader Pixel Shader
Emits primitives of a specified output type (point, linestrip, trianglestrip) Limited geometry amplification/de-
amplification: Output 0-1024 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
Geometry Shader
Geometry ShaderAmplification and De-Amplification
Vertex Shader Pixel Shader
Geometry Shader
Emits primitives of a specified output type (point, linestrip, trianglestrip) Limited geometry amplification/de-
amplification: Output 0-1024 values per invocation
No more 1 in / 1 out limit! Shadow Volumes/Fur/Fins Procedural Geometry/Detailing All-GPU Particle Systems Point Sprites
Geometry ShaderSystem-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
Geometry ShaderSystem-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
Geometry Shader
RenderTargetArrayIndex = 2
VertexShader
Rasterizer/Interpolator
GeometryShader
Texture
Texture
Stream Output
Stream Output
Streams VS/GS results to one or more buffersin memory
DrawAuto() to draw dynamic amounts of GS data without App/CPU intervention
Uses: Iterative/procedural
geometry processingAll-GPU
particle systems…
DrawAuto()