SlideShare a Scribd company logo
1 of 56
v4 DirectX 11 Rendering in Battlefield 3 Johan Andersson, Rendering Architect, DICE
Agenda Overview Feature: Deferred Shading Compute Shader Tile-Based Lighting Terrain Displacement Mapping Direct Stereo 3D rendering Quality: Antialiasing: MSAA Antialiasing: FXAA Antialiasing: SRAA Transparency Supersampling Performance: Instancing Parallel dispatch Multi-GPU Resource Streaming Conclusions Q & A
overview
Battlefield 3 FPS Fall 2011 DX11, Xbox 360 and PS3 Frostbite 2 engine
Frostbite 2 Developed for Battlefield 3 and future DICE/EA games Massive focus on creating simple to use & powerful workflows Major pushes in animation, destruction, streaming, rendering, lightingand landscapes
DX11 DX11 API only Requires a DX10 or DX11 GPUs Requires Vista SP1 or Windows 7 No Windows XP! Why? CPU performance win GPU performance & quality win Ease ofdevelopment - no legacy Future proof BF3 is a big title - will drive OS & HW adoption Which is good for your game as well! 
Options for rendering Switched to Deferred Shading in FB2 Rich mix of Outdoor + Indoor + Urban environments in BF3 Wanted lots more light sources Why not Forward Rendering? Light culling / shader permutations not efficient for us Expensive & more difficultdecaling / destruction masking Why not Light Pre-pass? 2x geometry pass too expensive on both CPU & GPU for us Was able to generalize our BRDF enough to just a few variations  Saw major potential in full tile-based deferred shading See also: Nicolas Thibieroz’s talk ”Deferred Shading Optimizations”
Deferred Shading Weaknesses with traditional deferred lighting/shading: Massive overdraw & ROP cost when having lots of big light sources Expensive to have multiple per-pixel materials in light shaders MSAA lighting can be slow (non-coherent, extra BW)
features
Tile-based Deferred Shading 1. Divide screen into tiles and determine which lights affects which tiles 2. Only apply the visible light sources on pixels  Custom shader with multiple lights Reduced bandwidth & setup cost How can we do this best in DX11?
Lighting with Compute Shader Tile-based Deferred Shading using Compute Shaders Primarily for analytical light sources Point lights, cone lights, line lights No shadows Requires Compute Shader 5.0 Hybrid Graphics/Compute shading pipeline: Graphics pipeline rasterizes gbuffers for opaque surfaces Compute pipeline uses gbuffers, culls lights, computes lighting & combines with shading Graphics pipeline renders transparent surfaces on top
CS requirements & setup 1 thread per pixel, 16x16 thread groups (aka tile) Input: gbuffers, depth buffer & list oflights Output: fully composited & lit HDR texture Normal Roughness Texture2D<float4> gbufferTexture0 : register(t0); Texture2D<float4> gbufferTexture1 : register(t1); Texture2D<float4> gbufferTexture2 : register(t2); Texture2D<float4> depthTexture : register(t3); RWTexture2D<float4> outputTexture : register(u0); #define BLOCK_SIZE 16 [numthreads(BLOCK_SIZE,BLOCK_SIZE,1)] void csMain(     uint3 groupId : SV_GroupID,     uint3 groupThreadId : SV_GroupThreadID,     uint groupIndex: SV_GroupIndex,     uint3 dispatchThreadId : SV_DispatchThreadID) {     ... } Diffuse Albedo Specular Albedo
groupshared uint minDepthInt; groupshared uint maxDepthInt; // --- globals above, function below ------- float depth =        depthTexture.Load(uint3(texCoord, 0)).r; uint depthInt = asuint(depth); minDepthInt = 0xFFFFFFFF; maxDepthInt = 0; GroupMemoryBarrierWithGroupSync(); InterlockedMin(minDepthInt, depthInt); InterlockedMax(maxDepthInt, depthInt); GroupMemoryBarrierWithGroupSync(); float minGroupDepth = asfloat(minDepthInt); float maxGroupDepth = asfloat(maxDepthInt); CS steps 1-2 1. Load gbuffers & depth 2. Calculate min & max z in threadgroup / tile Using InterlockedMin/Max on groupshared variable Atomics only work on ints  Can cast float to int (z is always +)
CS step 3 – Culling Determine visible light sources for each tile Cull all light sources against tile frustum Input (global):  Light list, frustum& SW occlusionculled Output (per tile): # of visible light sources Index list of visible light sources Per-tile visible light count (black = 0 lights, white = 40)
struct Light {     float3 pos; float sqrRadius;     float3 color; float invSqrRadius; }; int lightCount; StructuredBuffer<Light> lights; groupshared uint visibleLightCount = 0; groupshared uint visibleLightIndices[1024]; // --- globals above, cont. function below --- uint threadCount = BLOCK_SIZE*BLOCK_SIZE;  uint passCount = (lightCount+threadCount-1) / threadCount; for (uint passIt = 0; passIt < passCount; ++passIt)  {     uint lightIndex = passIt*threadCount + groupIndex;     // prevent overrun by clamping to a last ”null” light     lightIndex = min(lightIndex, lightCount);      if (intersects(lights[lightIndex], tile))     {         uint offset;         InterlockedAdd(visibleLightCount, 1, offset);         visibleLightIndices[offset] = lightIndex;     }	 } GroupMemoryBarrierWithGroupSync(); 3a. Each thread switches to process lights instead of pixels Wow, parallelism switcharoo! 256 light sources in parallel  Multiple iterations for >256 lights 3b. Intersect light and tile Multiple variants – accuracy vsperf Tile min & max z is used as a ”depth bounds” test 3c. Append visible light indices to list Atomic add to threadgroup shared memory ”inlined stream compaction” 3d. Switch back to processing pixels Synchronize the thread group We now know which light sources affect the tile CS step 3 – Impl
CS deferred shading final steps 4. For each pixel, accumulate lighting from visible lights Read from tile visible light index list in groupshared memory 5. Combine lighting & shadingalbedos Output is non-MSAA HDR texture Render transparent surfaces on top Computed lighting float3 color = 0; for (uintlightIt = 0; lightIt < visibleLightCount; ++lightIt) { uintlightIndex = visibleLightIndices[lightIt]; Lightlight = lights[lightIndex];		     color += diffuseAlbedo * evaluateLightDiffuse(light, gbuffer);     color += specularAlbedo * evaluateLightSpecular(light, gbuffer); }
Massive lighting test scene - 1000 large point lights GDC 2011 test content
MSAA Compute Shader Lighting Only edge pixels need full per-sample lighting But edges have bad screen-space coherency! Inefficient Compute Shader can build efficient coherent pixel list Evaluate lighting for each pixel (sample 0) Determine if pixel requires per-sample lighting If so, add to atomic list in shared memory When all pixels are done, synchronize Go through and light sample 1-3 for pixels in list Major performance improvement! Described in detail in [Lauritzen10]
Terrain rendering
Terrain rendering Battlefield 3 terrains Huge area & massive view distances Dynamic destructible heightfields Procedural virtual texturing Streamed heightfields, colormaps, masks Full details at at a later conference We stream in source heightfield data at close to pixel ratio Derive high-quality per-pixel normals in shader How can we increase detail even further on DX11? Create better silhouettes and improved depth Keep small-scale detail (dynamic craters & slopes)
>
Normal mapped terrain
Displacement mapped terrain
Terrain Displacement Mapping Straight high-res heightfields, no procedural detail Lots of data in the heightfields Pragmatic & simple choice No changes in physics/collisions No content changes, artists see the true detail they created Uses DX11 fixed edge tessellation factors Stable, no swimming vertices  Though can be wasteful Height morphing for streaming by fetching 2 heightfields in domain shader & blend based on patch CLOD factor More work left to figure optimal tessellation scheme for our use case
Stereo 3D rendering in DX11 Nvidia’s 3D Visiondrivers is a good and almost automatic stereo 3D rendering method  But only for forward rendering, doesn’t work with deferred shading Or on AMD or Intel GPUs Transparent surfaces do not get proper 3D depth We instead use explicit 3D stereo rendering Render unique frame for each eye Works with deferred shading & includes all surfaces Higher performance requirements, 2x draw calls Works with Nvidia’s 3D Vision and AMD’s HD3D Similar to OpenGL quad buffer support Ask your friendly IHV contact how
PERFORMANCE
Instancing Draw calls can still be major performance bottleneck Lots of materials / lots of variation Complex shadowmaps High detail / long view distances Full 3D stereo rendering Battlefield have lots of use cases for heavy instancing Props, foliage, debris, destruction, mesh particles Batching submissions is still important, just as before! Richard Huddy: ”Batch batch batch!”
Instancing in DirectX DX9-style stream instancing is good, but restrictive Extra vertex attributes, GPU overhead Can’t be (efficiently) combined with skinning Used primarily for tiny meshes (particles, foliage) DX10/DX11 brings support for shader Buffer objects Vertex shaders have access to SV_InstanceID Can do completely arbitrary loads, not limited to fixed elements Can support per-instance arrays and other data structures! Let’s rethink how instancing can be implemented..
Instancing data Multiple object types Rigid / skinned / composite meshes Multiple object lighting types Small/dynamic: light probes Large/static: light maps Different types of instancing data we have Transform 		float4x3 Skinning transforms 	float4x3 array SH light probe 		float4 x 4 Lightmap UV scale/offset 	float4 Let’s pack all instancing data into single  big buffer!
Buffer<float4> instanceVectorBuffer : register(t0); cbuffera {     float g_startVector; float g_vectorsPerInstance; } VsOutputmain(     // ....     uint instanceId : SV_InstanceId) {     uint worldMatrixVectorOffset = g_startVector + input.instanceId * g_vectorsPerInstance + 0;         uint probeVectorOffset       = g_startVector + input.instanceId * g_vectorsPerInstance + 3;     float4 r0 = instanceVectorBuffer.Load(worldMatrixVectorOffset + 0);     float4 r1 = instanceVectorBuffer.Load(worldMatrixVectorOffset + 1);     float4 r2 = instanceVectorBuffer.Load(worldMatrixVectorOffset + 2);     float4 lightProbeShR = instanceVectorBuffer.Load(probeVectorOffset + 0);     float4 lightProbeShG = instanceVectorBuffer.Load(probeVectorOffset + 1);     float4 lightProbeShB = instanceVectorBuffer.Load(probeVectorOffset + 2);     float4 lightProbeShO = instanceVectorBuffer.Load(probeVectorOffset + 3);     // .... } Instancing example: transform + SH
half4 weights = input.boneWeights; int4 indices = (int4)input.boneIndices; float4 skinnedPos =  mul(float4(pos,1), getSkinningMatrix(indices[0])).xyz * weights[0]; skinnedPos += mul(float4(pos,1), getSkinningMatrix(indices[1])).xyz * weights[1]; skinnedPos += mul(float4(pos,1), getSkinningMatrix(indices[2])).xyz * weights[2]; skinnedPos += mul(float4(pos,1), getSkinningMatrix(indices[3])).xyz * weights[3]; // ... float4x3 getSkinningMatrix(uintboneIndex) { uintvectorOffset = g_startVector + instanceId * g_vectorsPerInstance; vectorOffset += boneIndex*3;     float4 r0 = instanceVectorBuffer.Load(vectorOffset + 0);     float4 r1 = instanceVectorBuffer.Load(vectorOffset + 1);     float4 r2 = instanceVectorBuffer.Load(vectorOffset + 2); return createMat4x3(r0, r1, r2); } Instancing example: skinning
Instancing benefits Single draw call per object type instead of per instance Minor GPU hit for big CPU gain Instancing does not break when skinning parts More deterministic & better overall performance End result is typically 1500-2000 draw calls Regardless of how many object instances the artists place! Instead of 3000-7000 draw calls in some heavy cases
Parallel Dispatch in Theory Great key DX11 feature! Improve performance by scaling dispatching to D3D to more cores Reduce frame latency How we use it: DX11 deferred context per HW thread Renderer builds list of all draw calls we want to do for each rendering ”layer” of the frame Split draw calls for each layer into chunks of ~256  Dispatch chunks in parallel to the deferred contexts to generate command lists Render to immediate context & execute command lists Profit! * * but theory != practice
Parallel Dispatch in Practice Still no performant drivers available for our use case  Have waited for 2 years and still are Big driver codebases takes time to refactor IHVs vs Microsoft quagmire Heavy driver threads collide with game threads How it should work (an utopia?) Driver does not create any processing threads of its own Game submits workload in parallel to multiple deferred contexts Driver make sure almost all processing required happens on the draw call on the deferred context Game dispatches command list on immediate context, driver does absolute minimal work with it Still good to design engine for + instancing is great! quagmire [ˈkwægˌmaɪə ˈkwɒg-]n 1. (Earth Sciences / Physical Geography) a soft wet area of land that gives way under the feet; bog 2. an awkward, complex, or embarrassing situation
Resource streaming Even with modern GPUs with lots of memory, resource streaming is often required Can’t require 1+ GB graphics cards BF3 levels have much more than 1 GB of textures & meshes Reduced load times But creating & destroying DX resources in-frame has never been a good thing Can cause non-deterministic & large driver / OS stalls  Has been a problem for a very long time in DX About time to fix it
DX11 Resource Streaming Have worked with Microsoft, Nvidia & AMD to make sure we can do stall free async resource streaming of GPU resources in DX11 Want neither CPU nor GPU perf hit Key foundation: DX11 concurrent creates Resource creation flow: Streaming system determines resources toload (texturemipmaps or meshLODs) Add up DX resource creation on to queue on our own separate low-priority thread Thread creates resources using initial data, signals streaming system Resource created, game starts using it Enablesasync stall-free DMA in drivers! Resource destruction flow: Streaming system deletes D3D resource Driver keeps it internally alive until GPU frames using it are done. NO STALL! D3D11_FEATURE_DATA_THREADING threadingCaps; FB_SAFE_DX(m_device->CheckFeatureSupport(    D3D11_FEATURE_THREADING,    &threadingCaps, sizeof(threadingCaps))); if (threadingCaps.DriverConcurrentCreates)
Multi-GPU Efficiently supporting Crossfire and SLI is important for us High-end consumers expect it IHVs expect it (and can help!) Allows targeting higher-end HW then currently available during dev AFR is easy: Do not reuse GPU resources from previous frame! UpdateSubResourceis easy & robust to use for dynamic resources, but not ideal All of our playtests run with exe named AFR-FriendlyD3D.exe  Disables all driver AFR synchronization workarounds Rather find corruption during dev then have bad perf ForceSingleGPU.exe is also useful to track down issues
quality
Antialiasing Reducing aliasing is one of our key visual priorities Creates a more smooth gameplay experience Extra challenging goal due to deferred shading We use multiple methods: MSAA –Multisample Antialiasing FXAA – Fast Approximate Antialiasing SRAA – Sub-pixel Reconstruction Antialiasing TSAA – Transparency Supersampling Antialiasing Aliasing
MSAA Our solution:  Deferred geometry pass renders with MSAA (2x, 4x or 8x) Light shaders evaluate per-sample (when needed), averages the samples and writes out per-pixel Transparent surfaces rendered on top without MSAA 1080p gbuffer+z with 4x MSAA is 158 MB Lots of memory and lots of bandwidth  Could be tiled to reduce memory usage Very nice quality though  Our (overall) highest quality option But not fast enough for more GPUs Need additional solution(s)..
FXAA ”Fast Approximate Antialiasing” GPU-based MLAA implementation by Timothy Lottes (Nvidia) Multiple quality options ~1.3 ms/f for 1080p on Geforce 580 Pros & cons: Superb antialiased long edges!  Smooth overall picture  Reasonably fast  Moving pictures do not benefit as much  ”Blurry aliasing”  Will be released here at GDC’11  Part of Nvidia’s example SDK
SRAA ”Sub-pixel Reconstruction Antialiasing” Presented at I3D’11 2 weeks ago [Chajdas11] Use 4x MSAA buffers to improve reconstruction Multiple variants: MSAA depth buffer MSAA depth buffer + normal buffer MSAA Primitive ID / spatial hashing buffer Pros: Better at capturing small scale detail  Less ”pixel snapping” than MLAA variants  Cons: Extra MSAA z/normal/id pass can be prohibitive  Integration not as easy due to extra pass 
No antialiasing
4x MSAA
4x SRAA, depth-only
4x SRAA, depth+normal
FXAA
No antialiasing
MSAA Sample Coverage None of the AA solutions can solve all aliasing Foliage & other alpha-tested surfaces are extra difficult cases Undersampled geometry, requires sub-samples  DX 10.1 added SV_COVERAGE as a pixel shader output DX 11 added SV_COVERAGE as a pixel shader input What does this mean? We get full programmable control over the coverage mask No need to waste the alpha channel output (great for deferred) We can do partial supersampling on alpha-tested surfaces!
Transparency Supersampling static const float2 msaaOffsets[4] = {     float2(-0.125, -0.375),    float2(0.375, -0.125),     float2(-0.375,  0.125),    float2(0.125,  0.375) }; void psMain(    out float4 color : SV_Target,     out uint coverage : SV_Coverage) {     float2 texCoord_ddx = ddx(texCoord);     float2 texCoord_ddy = ddy(texCoord);     coverage = 0;     [unroll]     for (int i = 0; i < 4; ++i)     {         float2 texelOffset = msaaOffsets[i].x * texCoord_ddx;         texelOffset +=       msaaOffsets[i].y * texCoord_ddy;         float4 temp = tex.SampleLevel(sampler, texCoord + texelOffset);         if (temp.a >= 0.5)             coverage |= 1<<i;     } } Shade per-pixel but evaluate alpha test per-sample Write out coverage bitmask MSAA offsets are defined in DX 10.1 Requires shader permutation for each MSAA level Gradients still quite limited But much better than standard MSAA!  Can combine with screen-space dither See also: DirectX SDK ’TransparencyAA10.1 GDC’09 STALKER talk [Lobanchikov09]
Alpha testing 4x MSAA + Transparency Supersampling
Conclusions DX11 is here – in force 2011 is a great year to focus on DX11 2012 will be a great year for more to drop DX9 We’ve found lots & lots of quality & performance enhancing features using DX11 And so will you for your game! Still have only started, lots of potential Take advantage of the PC strengths, don’t hold it back Big end-user value Good preparation for Gen4
Thanks Christina Coffin (@ChristinaCoffin) Mattias Widmark Kenny Magnusson Colin Barré-Brisebois (@ZigguratVertigo) Timothy Lottes (@TimothyLottes) Matthäus G. Chajdas (@NIV_Anteru) Miguel Sainz Nicolas Thibieroz Battlefield team Frostbite team Microsoft Nvidia AMD Intel
Questions? Email: repi@dice.se Blog:     http://repi.se Twitter: @repi Battlefield 3 & Frostbite 2 talks at GDC’11: For more DICE talks: http://publications.dice.se
References [Lobanchikov09] Igor A. Lobanchikov, ”GSC Game World’s STALKER: Clear Sky – a showcase for Direct3D 10.0/1” GDC’09. http://developer.amd.com/gpu_assets/01gdc09ad3ddstalkerclearsky210309.ppt [Lauritzen10] Andrew Lauritzen, ”Deferred Rendering for Current and Future Rendering Pipelines” SIGGRAPH’10 http://bps10.idav.ucdavis.edu/ [Chajdas11] Matthäus G. Chajdas et al ”Subpixel Reconstruction Antialiasing for Deferred Shading.”. I3D’11

More Related Content

What's hot

Screen Space Reflections in The Surge
Screen Space Reflections in The SurgeScreen Space Reflections in The Surge
Screen Space Reflections in The SurgeMichele Giacalone
 
The Rendering Technology of Killzone 2
The Rendering Technology of Killzone 2The Rendering Technology of Killzone 2
The Rendering Technology of Killzone 2Guerrilla
 
SPU-Based Deferred Shading in BATTLEFIELD 3 for Playstation 3
SPU-Based Deferred Shading in BATTLEFIELD 3 for Playstation 3SPU-Based Deferred Shading in BATTLEFIELD 3 for Playstation 3
SPU-Based Deferred Shading in BATTLEFIELD 3 for Playstation 3Electronic Arts / DICE
 
Frostbite Rendering Architecture and Real-time Procedural Shading & Texturing...
Frostbite Rendering Architecture and Real-time Procedural Shading & Texturing...Frostbite Rendering Architecture and Real-time Procedural Shading & Texturing...
Frostbite Rendering Architecture and Real-time Procedural Shading & Texturing...Johan Andersson
 
Moving Frostbite to Physically Based Rendering
Moving Frostbite to Physically Based RenderingMoving Frostbite to Physically Based Rendering
Moving Frostbite to Physically Based RenderingElectronic Arts / DICE
 
Low-level Shader Optimization for Next-Gen and DX11 by Emil Persson
Low-level Shader Optimization for Next-Gen and DX11 by Emil PerssonLow-level Shader Optimization for Next-Gen and DX11 by Emil Persson
Low-level Shader Optimization for Next-Gen and DX11 by Emil PerssonAMD Developer Central
 
FrameGraph: Extensible Rendering Architecture in Frostbite
FrameGraph: Extensible Rendering Architecture in FrostbiteFrameGraph: Extensible Rendering Architecture in Frostbite
FrameGraph: Extensible Rendering Architecture in FrostbiteElectronic Arts / DICE
 
Secrets of CryENGINE 3 Graphics Technology
Secrets of CryENGINE 3 Graphics TechnologySecrets of CryENGINE 3 Graphics Technology
Secrets of CryENGINE 3 Graphics TechnologyTiago Sousa
 
Taking Killzone Shadow Fall Image Quality Into The Next Generation
Taking Killzone Shadow Fall Image Quality Into The Next GenerationTaking Killzone Shadow Fall Image Quality Into The Next Generation
Taking Killzone Shadow Fall Image Quality Into The Next GenerationGuerrilla
 
GDC 2014 - Deformable Snow Rendering in Batman: Arkham Origins
GDC 2014 - Deformable Snow Rendering in Batman: Arkham OriginsGDC 2014 - Deformable Snow Rendering in Batman: Arkham Origins
GDC 2014 - Deformable Snow Rendering in Batman: Arkham OriginsColin Barré-Brisebois
 
The Guerrilla Guide to Game Code
The Guerrilla Guide to Game CodeThe Guerrilla Guide to Game Code
The Guerrilla Guide to Game CodeGuerrilla
 
Parallel Graphics in Frostbite - Current & Future (Siggraph 2009)
Parallel Graphics in Frostbite - Current & Future (Siggraph 2009)Parallel Graphics in Frostbite - Current & Future (Siggraph 2009)
Parallel Graphics in Frostbite - Current & Future (Siggraph 2009)Johan Andersson
 
HPG 2018 - Game Ray Tracing: State-of-the-Art and Open Problems
HPG 2018 - Game Ray Tracing: State-of-the-Art and Open ProblemsHPG 2018 - Game Ray Tracing: State-of-the-Art and Open Problems
HPG 2018 - Game Ray Tracing: State-of-the-Art and Open ProblemsElectronic Arts / DICE
 
Hable John Uncharted2 Hdr Lighting
Hable John Uncharted2 Hdr LightingHable John Uncharted2 Hdr Lighting
Hable John Uncharted2 Hdr Lightingozlael ozlael
 
Checkerboard Rendering in Dark Souls: Remastered by QLOC
Checkerboard Rendering in Dark Souls: Remastered by QLOCCheckerboard Rendering in Dark Souls: Remastered by QLOC
Checkerboard Rendering in Dark Souls: Remastered by QLOCQLOC
 
Past, Present and Future Challenges of Global Illumination in Games
Past, Present and Future Challenges of Global Illumination in GamesPast, Present and Future Challenges of Global Illumination in Games
Past, Present and Future Challenges of Global Illumination in GamesColin Barré-Brisebois
 

What's hot (20)

Screen Space Reflections in The Surge
Screen Space Reflections in The SurgeScreen Space Reflections in The Surge
Screen Space Reflections in The Surge
 
The Rendering Technology of Killzone 2
The Rendering Technology of Killzone 2The Rendering Technology of Killzone 2
The Rendering Technology of Killzone 2
 
SPU-Based Deferred Shading in BATTLEFIELD 3 for Playstation 3
SPU-Based Deferred Shading in BATTLEFIELD 3 for Playstation 3SPU-Based Deferred Shading in BATTLEFIELD 3 for Playstation 3
SPU-Based Deferred Shading in BATTLEFIELD 3 for Playstation 3
 
Frostbite Rendering Architecture and Real-time Procedural Shading & Texturing...
Frostbite Rendering Architecture and Real-time Procedural Shading & Texturing...Frostbite Rendering Architecture and Real-time Procedural Shading & Texturing...
Frostbite Rendering Architecture and Real-time Procedural Shading & Texturing...
 
Moving Frostbite to Physically Based Rendering
Moving Frostbite to Physically Based RenderingMoving Frostbite to Physically Based Rendering
Moving Frostbite to Physically Based Rendering
 
Low-level Shader Optimization for Next-Gen and DX11 by Emil Persson
Low-level Shader Optimization for Next-Gen and DX11 by Emil PerssonLow-level Shader Optimization for Next-Gen and DX11 by Emil Persson
Low-level Shader Optimization for Next-Gen and DX11 by Emil Persson
 
FrameGraph: Extensible Rendering Architecture in Frostbite
FrameGraph: Extensible Rendering Architecture in FrostbiteFrameGraph: Extensible Rendering Architecture in Frostbite
FrameGraph: Extensible Rendering Architecture in Frostbite
 
Secrets of CryENGINE 3 Graphics Technology
Secrets of CryENGINE 3 Graphics TechnologySecrets of CryENGINE 3 Graphics Technology
Secrets of CryENGINE 3 Graphics Technology
 
Taking Killzone Shadow Fall Image Quality Into The Next Generation
Taking Killzone Shadow Fall Image Quality Into The Next GenerationTaking Killzone Shadow Fall Image Quality Into The Next Generation
Taking Killzone Shadow Fall Image Quality Into The Next Generation
 
Masked Occlusion Culling
Masked Occlusion CullingMasked Occlusion Culling
Masked Occlusion Culling
 
Shiny PC Graphics in Battlefield 3
Shiny PC Graphics in Battlefield 3Shiny PC Graphics in Battlefield 3
Shiny PC Graphics in Battlefield 3
 
GDC 2014 - Deformable Snow Rendering in Batman: Arkham Origins
GDC 2014 - Deformable Snow Rendering in Batman: Arkham OriginsGDC 2014 - Deformable Snow Rendering in Batman: Arkham Origins
GDC 2014 - Deformable Snow Rendering in Batman: Arkham Origins
 
The Guerrilla Guide to Game Code
The Guerrilla Guide to Game CodeThe Guerrilla Guide to Game Code
The Guerrilla Guide to Game Code
 
Light prepass
Light prepassLight prepass
Light prepass
 
Parallel Graphics in Frostbite - Current & Future (Siggraph 2009)
Parallel Graphics in Frostbite - Current & Future (Siggraph 2009)Parallel Graphics in Frostbite - Current & Future (Siggraph 2009)
Parallel Graphics in Frostbite - Current & Future (Siggraph 2009)
 
Stochastic Screen-Space Reflections
Stochastic Screen-Space ReflectionsStochastic Screen-Space Reflections
Stochastic Screen-Space Reflections
 
HPG 2018 - Game Ray Tracing: State-of-the-Art and Open Problems
HPG 2018 - Game Ray Tracing: State-of-the-Art and Open ProblemsHPG 2018 - Game Ray Tracing: State-of-the-Art and Open Problems
HPG 2018 - Game Ray Tracing: State-of-the-Art and Open Problems
 
Hable John Uncharted2 Hdr Lighting
Hable John Uncharted2 Hdr LightingHable John Uncharted2 Hdr Lighting
Hable John Uncharted2 Hdr Lighting
 
Checkerboard Rendering in Dark Souls: Remastered by QLOC
Checkerboard Rendering in Dark Souls: Remastered by QLOCCheckerboard Rendering in Dark Souls: Remastered by QLOC
Checkerboard Rendering in Dark Souls: Remastered by QLOC
 
Past, Present and Future Challenges of Global Illumination in Games
Past, Present and Future Challenges of Global Illumination in GamesPast, Present and Future Challenges of Global Illumination in Games
Past, Present and Future Challenges of Global Illumination in Games
 

Similar to DirectX 11 Rendering in Battlefield 3

Gdc2011 direct x 11 rendering in battlefield 3
Gdc2011 direct x 11 rendering in battlefield 3Gdc2011 direct x 11 rendering in battlefield 3
Gdc2011 direct x 11 rendering in battlefield 3drandom
 
Your Game Needs Direct3D 11, So Get Started Now!
Your Game Needs Direct3D 11, So Get Started Now!Your Game Needs Direct3D 11, So Get Started Now!
Your Game Needs Direct3D 11, So Get Started Now!Johan Andersson
 
D3 D10 Unleashed New Features And Effects
D3 D10 Unleashed   New Features And EffectsD3 D10 Unleashed   New Features And Effects
D3 D10 Unleashed New Features And EffectsThomas Goddard
 
Triangle Visibility buffer
Triangle Visibility bufferTriangle Visibility buffer
Triangle Visibility bufferWolfgang Engel
 
The Intersection of Game Engines & GPUs: Current & Future (Graphics Hardware ...
The Intersection of Game Engines & GPUs: Current & Future (Graphics Hardware ...The Intersection of Game Engines & GPUs: Current & Future (Graphics Hardware ...
The Intersection of Game Engines & GPUs: Current & Future (Graphics Hardware ...Johan Andersson
 
Gpu presentation
Gpu presentationGpu presentation
Gpu presentationspartasoft
 
OpenGL 3.2 and More
OpenGL 3.2 and MoreOpenGL 3.2 and More
OpenGL 3.2 and MoreMark Kilgard
 
NVIDIA's OpenGL Functionality
NVIDIA's OpenGL FunctionalityNVIDIA's OpenGL Functionality
NVIDIA's OpenGL FunctionalityMark Kilgard
 
NVIDIA Graphics, Cg, and Transparency
NVIDIA Graphics, Cg, and TransparencyNVIDIA Graphics, Cg, and Transparency
NVIDIA Graphics, Cg, and TransparencyMark Kilgard
 
The Rendering Pipeline - Challenges & Next Steps
The Rendering Pipeline - Challenges & Next StepsThe Rendering Pipeline - Challenges & Next Steps
The Rendering Pipeline - Challenges & Next StepsJohan Andersson
 
The technology behind_the_elemental_demo_16x9-1248544805
The technology behind_the_elemental_demo_16x9-1248544805The technology behind_the_elemental_demo_16x9-1248544805
The technology behind_the_elemental_demo_16x9-1248544805mistercteam
 
Destruction Masking in Frostbite 2 using Volume Distance Fields
Destruction Masking in Frostbite 2 using Volume Distance FieldsDestruction Masking in Frostbite 2 using Volume Distance Fields
Destruction Masking in Frostbite 2 using Volume Distance FieldsElectronic Arts / DICE
 
FlameWorks GTC 2014
FlameWorks GTC 2014FlameWorks GTC 2014
FlameWorks GTC 2014Simon Green
 
BitSquid Tech: Benefits of a data-driven renderer
BitSquid Tech: Benefits of a data-driven rendererBitSquid Tech: Benefits of a data-driven renderer
BitSquid Tech: Benefits of a data-driven renderertobias_persson
 
Commandlistsiggraphasia2014 141204005310-conversion-gate02
Commandlistsiggraphasia2014 141204005310-conversion-gate02Commandlistsiggraphasia2014 141204005310-conversion-gate02
Commandlistsiggraphasia2014 141204005310-conversion-gate02RubnCuesta2
 
Dissecting the Rendering of The Surge
Dissecting the Rendering of The SurgeDissecting the Rendering of The Surge
Dissecting the Rendering of The SurgePhilip Hammer
 
Rendering basics
Rendering basicsRendering basics
Rendering basicsicedmaster
 
FGS 2011: Making A Game With Molehill: Zombie Tycoon
FGS 2011: Making A Game With Molehill: Zombie TycoonFGS 2011: Making A Game With Molehill: Zombie Tycoon
FGS 2011: Making A Game With Molehill: Zombie Tycoonmochimedia
 

Similar to DirectX 11 Rendering in Battlefield 3 (20)

Gdc2011 direct x 11 rendering in battlefield 3
Gdc2011 direct x 11 rendering in battlefield 3Gdc2011 direct x 11 rendering in battlefield 3
Gdc2011 direct x 11 rendering in battlefield 3
 
Your Game Needs Direct3D 11, So Get Started Now!
Your Game Needs Direct3D 11, So Get Started Now!Your Game Needs Direct3D 11, So Get Started Now!
Your Game Needs Direct3D 11, So Get Started Now!
 
OpenGL 4 for 2010
OpenGL 4 for 2010OpenGL 4 for 2010
OpenGL 4 for 2010
 
D3 D10 Unleashed New Features And Effects
D3 D10 Unleashed   New Features And EffectsD3 D10 Unleashed   New Features And Effects
D3 D10 Unleashed New Features And Effects
 
Triangle Visibility buffer
Triangle Visibility bufferTriangle Visibility buffer
Triangle Visibility buffer
 
The Intersection of Game Engines & GPUs: Current & Future (Graphics Hardware ...
The Intersection of Game Engines & GPUs: Current & Future (Graphics Hardware ...The Intersection of Game Engines & GPUs: Current & Future (Graphics Hardware ...
The Intersection of Game Engines & GPUs: Current & Future (Graphics Hardware ...
 
Gpu presentation
Gpu presentationGpu presentation
Gpu presentation
 
OpenGL 3.2 and More
OpenGL 3.2 and MoreOpenGL 3.2 and More
OpenGL 3.2 and More
 
NVIDIA's OpenGL Functionality
NVIDIA's OpenGL FunctionalityNVIDIA's OpenGL Functionality
NVIDIA's OpenGL Functionality
 
NVIDIA Graphics, Cg, and Transparency
NVIDIA Graphics, Cg, and TransparencyNVIDIA Graphics, Cg, and Transparency
NVIDIA Graphics, Cg, and Transparency
 
The Rendering Pipeline - Challenges & Next Steps
The Rendering Pipeline - Challenges & Next StepsThe Rendering Pipeline - Challenges & Next Steps
The Rendering Pipeline - Challenges & Next Steps
 
The technology behind_the_elemental_demo_16x9-1248544805
The technology behind_the_elemental_demo_16x9-1248544805The technology behind_the_elemental_demo_16x9-1248544805
The technology behind_the_elemental_demo_16x9-1248544805
 
Destruction Masking in Frostbite 2 using Volume Distance Fields
Destruction Masking in Frostbite 2 using Volume Distance FieldsDestruction Masking in Frostbite 2 using Volume Distance Fields
Destruction Masking in Frostbite 2 using Volume Distance Fields
 
FlameWorks GTC 2014
FlameWorks GTC 2014FlameWorks GTC 2014
FlameWorks GTC 2014
 
BitSquid Tech: Benefits of a data-driven renderer
BitSquid Tech: Benefits of a data-driven rendererBitSquid Tech: Benefits of a data-driven renderer
BitSquid Tech: Benefits of a data-driven renderer
 
Commandlistsiggraphasia2014 141204005310-conversion-gate02
Commandlistsiggraphasia2014 141204005310-conversion-gate02Commandlistsiggraphasia2014 141204005310-conversion-gate02
Commandlistsiggraphasia2014 141204005310-conversion-gate02
 
Xbox
XboxXbox
Xbox
 
Dissecting the Rendering of The Surge
Dissecting the Rendering of The SurgeDissecting the Rendering of The Surge
Dissecting the Rendering of The Surge
 
Rendering basics
Rendering basicsRendering basics
Rendering basics
 
FGS 2011: Making A Game With Molehill: Zombie Tycoon
FGS 2011: Making A Game With Molehill: Zombie TycoonFGS 2011: Making A Game With Molehill: Zombie Tycoon
FGS 2011: Making A Game With Molehill: Zombie Tycoon
 

More from Electronic Arts / DICE

GDC2019 - SEED - Towards Deep Generative Models in Game Development
GDC2019 - SEED - Towards Deep Generative Models in Game DevelopmentGDC2019 - SEED - Towards Deep Generative Models in Game Development
GDC2019 - SEED - Towards Deep Generative Models in Game DevelopmentElectronic Arts / DICE
 
SIGGRAPH 2010 - Style and Gameplay in the Mirror's Edge
SIGGRAPH 2010 - Style and Gameplay in the Mirror's EdgeSIGGRAPH 2010 - Style and Gameplay in the Mirror's Edge
SIGGRAPH 2010 - Style and Gameplay in the Mirror's EdgeElectronic Arts / DICE
 
Syysgraph 2018 - Modern Graphics Abstractions & Real-Time Ray Tracing
Syysgraph 2018 - Modern Graphics Abstractions & Real-Time Ray TracingSyysgraph 2018 - Modern Graphics Abstractions & Real-Time Ray Tracing
Syysgraph 2018 - Modern Graphics Abstractions & Real-Time Ray TracingElectronic Arts / DICE
 
Khronos Munich 2018 - Halcyon and Vulkan
Khronos Munich 2018 - Halcyon and VulkanKhronos Munich 2018 - Halcyon and Vulkan
Khronos Munich 2018 - Halcyon and VulkanElectronic Arts / DICE
 
CEDEC 2018 - Towards Effortless Photorealism Through Real-Time Raytracing
CEDEC 2018 - Towards Effortless Photorealism Through Real-Time RaytracingCEDEC 2018 - Towards Effortless Photorealism Through Real-Time Raytracing
CEDEC 2018 - Towards Effortless Photorealism Through Real-Time RaytracingElectronic Arts / DICE
 
CEDEC 2018 - Functional Symbiosis of Art Direction and Proceduralism
CEDEC 2018 - Functional Symbiosis of Art Direction and ProceduralismCEDEC 2018 - Functional Symbiosis of Art Direction and Proceduralism
CEDEC 2018 - Functional Symbiosis of Art Direction and ProceduralismElectronic Arts / DICE
 
SIGGRAPH 2018 - PICA PICA and NVIDIA Turing
SIGGRAPH 2018 - PICA PICA and NVIDIA TuringSIGGRAPH 2018 - PICA PICA and NVIDIA Turing
SIGGRAPH 2018 - PICA PICA and NVIDIA TuringElectronic Arts / DICE
 
SIGGRAPH 2018 - Full Rays Ahead! From Raster to Real-Time Raytracing
SIGGRAPH 2018 - Full Rays Ahead! From Raster to Real-Time RaytracingSIGGRAPH 2018 - Full Rays Ahead! From Raster to Real-Time Raytracing
SIGGRAPH 2018 - Full Rays Ahead! From Raster to Real-Time RaytracingElectronic Arts / DICE
 
EPC 2018 - SEED - Exploring The Collaboration Between Proceduralism & Deep Le...
EPC 2018 - SEED - Exploring The Collaboration Between Proceduralism & Deep Le...EPC 2018 - SEED - Exploring The Collaboration Between Proceduralism & Deep Le...
EPC 2018 - SEED - Exploring The Collaboration Between Proceduralism & Deep Le...Electronic Arts / DICE
 
DD18 - SEED - Raytracing in Hybrid Real-Time Rendering
DD18 - SEED - Raytracing in Hybrid Real-Time RenderingDD18 - SEED - Raytracing in Hybrid Real-Time Rendering
DD18 - SEED - Raytracing in Hybrid Real-Time RenderingElectronic Arts / DICE
 
Creativity of Rules and Patterns: Designing Procedural Systems
Creativity of Rules and Patterns: Designing Procedural SystemsCreativity of Rules and Patterns: Designing Procedural Systems
Creativity of Rules and Patterns: Designing Procedural SystemsElectronic Arts / DICE
 
Shiny Pixels and Beyond: Real-Time Raytracing at SEED
Shiny Pixels and Beyond: Real-Time Raytracing at SEEDShiny Pixels and Beyond: Real-Time Raytracing at SEED
Shiny Pixels and Beyond: Real-Time Raytracing at SEEDElectronic Arts / DICE
 
Future Directions for Compute-for-Graphics
Future Directions for Compute-for-GraphicsFuture Directions for Compute-for-Graphics
Future Directions for Compute-for-GraphicsElectronic Arts / DICE
 
A Certain Slant of Light - Past, Present and Future Challenges of Global Illu...
A Certain Slant of Light - Past, Present and Future Challenges of Global Illu...A Certain Slant of Light - Past, Present and Future Challenges of Global Illu...
A Certain Slant of Light - Past, Present and Future Challenges of Global Illu...Electronic Arts / DICE
 
Physically Based Sky, Atmosphere and Cloud Rendering in Frostbite
Physically Based Sky, Atmosphere and Cloud Rendering in FrostbitePhysically Based Sky, Atmosphere and Cloud Rendering in Frostbite
Physically Based Sky, Atmosphere and Cloud Rendering in FrostbiteElectronic Arts / DICE
 
High Dynamic Range color grading and display in Frostbite
High Dynamic Range color grading and display in FrostbiteHigh Dynamic Range color grading and display in Frostbite
High Dynamic Range color grading and display in FrostbiteElectronic Arts / DICE
 
4K Checkerboard in Battlefield 1 and Mass Effect Andromeda
4K Checkerboard in Battlefield 1 and Mass Effect Andromeda4K Checkerboard in Battlefield 1 and Mass Effect Andromeda
4K Checkerboard in Battlefield 1 and Mass Effect AndromedaElectronic Arts / DICE
 
Photogrammetry and Star Wars Battlefront
Photogrammetry and Star Wars BattlefrontPhotogrammetry and Star Wars Battlefront
Photogrammetry and Star Wars BattlefrontElectronic Arts / DICE
 

More from Electronic Arts / DICE (20)

GDC2019 - SEED - Towards Deep Generative Models in Game Development
GDC2019 - SEED - Towards Deep Generative Models in Game DevelopmentGDC2019 - SEED - Towards Deep Generative Models in Game Development
GDC2019 - SEED - Towards Deep Generative Models in Game Development
 
SIGGRAPH 2010 - Style and Gameplay in the Mirror's Edge
SIGGRAPH 2010 - Style and Gameplay in the Mirror's EdgeSIGGRAPH 2010 - Style and Gameplay in the Mirror's Edge
SIGGRAPH 2010 - Style and Gameplay in the Mirror's Edge
 
SEED - Halcyon Architecture
SEED - Halcyon ArchitectureSEED - Halcyon Architecture
SEED - Halcyon Architecture
 
Syysgraph 2018 - Modern Graphics Abstractions & Real-Time Ray Tracing
Syysgraph 2018 - Modern Graphics Abstractions & Real-Time Ray TracingSyysgraph 2018 - Modern Graphics Abstractions & Real-Time Ray Tracing
Syysgraph 2018 - Modern Graphics Abstractions & Real-Time Ray Tracing
 
Khronos Munich 2018 - Halcyon and Vulkan
Khronos Munich 2018 - Halcyon and VulkanKhronos Munich 2018 - Halcyon and Vulkan
Khronos Munich 2018 - Halcyon and Vulkan
 
CEDEC 2018 - Towards Effortless Photorealism Through Real-Time Raytracing
CEDEC 2018 - Towards Effortless Photorealism Through Real-Time RaytracingCEDEC 2018 - Towards Effortless Photorealism Through Real-Time Raytracing
CEDEC 2018 - Towards Effortless Photorealism Through Real-Time Raytracing
 
CEDEC 2018 - Functional Symbiosis of Art Direction and Proceduralism
CEDEC 2018 - Functional Symbiosis of Art Direction and ProceduralismCEDEC 2018 - Functional Symbiosis of Art Direction and Proceduralism
CEDEC 2018 - Functional Symbiosis of Art Direction and Proceduralism
 
SIGGRAPH 2018 - PICA PICA and NVIDIA Turing
SIGGRAPH 2018 - PICA PICA and NVIDIA TuringSIGGRAPH 2018 - PICA PICA and NVIDIA Turing
SIGGRAPH 2018 - PICA PICA and NVIDIA Turing
 
SIGGRAPH 2018 - Full Rays Ahead! From Raster to Real-Time Raytracing
SIGGRAPH 2018 - Full Rays Ahead! From Raster to Real-Time RaytracingSIGGRAPH 2018 - Full Rays Ahead! From Raster to Real-Time Raytracing
SIGGRAPH 2018 - Full Rays Ahead! From Raster to Real-Time Raytracing
 
EPC 2018 - SEED - Exploring The Collaboration Between Proceduralism & Deep Le...
EPC 2018 - SEED - Exploring The Collaboration Between Proceduralism & Deep Le...EPC 2018 - SEED - Exploring The Collaboration Between Proceduralism & Deep Le...
EPC 2018 - SEED - Exploring The Collaboration Between Proceduralism & Deep Le...
 
DD18 - SEED - Raytracing in Hybrid Real-Time Rendering
DD18 - SEED - Raytracing in Hybrid Real-Time RenderingDD18 - SEED - Raytracing in Hybrid Real-Time Rendering
DD18 - SEED - Raytracing in Hybrid Real-Time Rendering
 
Creativity of Rules and Patterns: Designing Procedural Systems
Creativity of Rules and Patterns: Designing Procedural SystemsCreativity of Rules and Patterns: Designing Procedural Systems
Creativity of Rules and Patterns: Designing Procedural Systems
 
Shiny Pixels and Beyond: Real-Time Raytracing at SEED
Shiny Pixels and Beyond: Real-Time Raytracing at SEEDShiny Pixels and Beyond: Real-Time Raytracing at SEED
Shiny Pixels and Beyond: Real-Time Raytracing at SEED
 
Future Directions for Compute-for-Graphics
Future Directions for Compute-for-GraphicsFuture Directions for Compute-for-Graphics
Future Directions for Compute-for-Graphics
 
A Certain Slant of Light - Past, Present and Future Challenges of Global Illu...
A Certain Slant of Light - Past, Present and Future Challenges of Global Illu...A Certain Slant of Light - Past, Present and Future Challenges of Global Illu...
A Certain Slant of Light - Past, Present and Future Challenges of Global Illu...
 
Physically Based Sky, Atmosphere and Cloud Rendering in Frostbite
Physically Based Sky, Atmosphere and Cloud Rendering in FrostbitePhysically Based Sky, Atmosphere and Cloud Rendering in Frostbite
Physically Based Sky, Atmosphere and Cloud Rendering in Frostbite
 
High Dynamic Range color grading and display in Frostbite
High Dynamic Range color grading and display in FrostbiteHigh Dynamic Range color grading and display in Frostbite
High Dynamic Range color grading and display in Frostbite
 
4K Checkerboard in Battlefield 1 and Mass Effect Andromeda
4K Checkerboard in Battlefield 1 and Mass Effect Andromeda4K Checkerboard in Battlefield 1 and Mass Effect Andromeda
4K Checkerboard in Battlefield 1 and Mass Effect Andromeda
 
Lighting the City of Glass
Lighting the City of GlassLighting the City of Glass
Lighting the City of Glass
 
Photogrammetry and Star Wars Battlefront
Photogrammetry and Star Wars BattlefrontPhotogrammetry and Star Wars Battlefront
Photogrammetry and Star Wars Battlefront
 

Recently uploaded

Fight Scene Storyboard (Action/Adventure Animation)
Fight Scene Storyboard (Action/Adventure Animation)Fight Scene Storyboard (Action/Adventure Animation)
Fight Scene Storyboard (Action/Adventure Animation)finlaygoodall2
 
Flying Avocado Cat Cryptocurrency Created, Coded, Generated and Named by Grok...
Flying Avocado Cat Cryptocurrency Created, Coded, Generated and Named by Grok...Flying Avocado Cat Cryptocurrency Created, Coded, Generated and Named by Grok...
Flying Avocado Cat Cryptocurrency Created, Coded, Generated and Named by Grok...TeslaStakeHolder
 
A Spotlight on Darla Leigh Pittman Rodgers: Aaron Rodgers' Mother
A Spotlight on Darla Leigh Pittman Rodgers: Aaron Rodgers' MotherA Spotlight on Darla Leigh Pittman Rodgers: Aaron Rodgers' Mother
A Spotlight on Darla Leigh Pittman Rodgers: Aaron Rodgers' Motherget joys
 
NO1 Certified Black magic specialist,Expert in Pakistan Amil Baba kala ilam E...
NO1 Certified Black magic specialist,Expert in Pakistan Amil Baba kala ilam E...NO1 Certified Black magic specialist,Expert in Pakistan Amil Baba kala ilam E...
NO1 Certified Black magic specialist,Expert in Pakistan Amil Baba kala ilam E...Amil Baba Dawood bangali
 
Statement Of Intent - - Copy.documentfile
Statement Of Intent - - Copy.documentfileStatement Of Intent - - Copy.documentfile
Statement Of Intent - - Copy.documentfilef4ssvxpz62
 
NO1 Certified kala ilam Expert In Peshwar Kala Jadu Specialist In Peshwar Kal...
NO1 Certified kala ilam Expert In Peshwar Kala Jadu Specialist In Peshwar Kal...NO1 Certified kala ilam Expert In Peshwar Kala Jadu Specialist In Peshwar Kal...
NO1 Certified kala ilam Expert In Peshwar Kala Jadu Specialist In Peshwar Kal...Amil Baba Dawood bangali
 
Behind the Scenes The Life of Enzo Zelocchi, a Hollywood Film Producer.pdf
Behind the Scenes The Life of Enzo Zelocchi, a Hollywood Film Producer.pdfBehind the Scenes The Life of Enzo Zelocchi, a Hollywood Film Producer.pdf
Behind the Scenes The Life of Enzo Zelocchi, a Hollywood Film Producer.pdfEnzo Zelocchi Fan Page
 
Taken Pilot Episode Story pitch Document
Taken Pilot Episode Story pitch DocumentTaken Pilot Episode Story pitch Document
Taken Pilot Episode Story pitch Documentf4ssvxpz62
 
Biswanath Byam Samiti Open Quiz 2022 by Qui9 Grand Finale
Biswanath Byam Samiti Open Quiz 2022 by Qui9 Grand FinaleBiswanath Byam Samiti Open Quiz 2022 by Qui9 Grand Finale
Biswanath Byam Samiti Open Quiz 2022 by Qui9 Grand FinaleQui9 (Ultimate Quizzing)
 
What Life Would Be Like From A Different Perspective (saltyvixenstories.com)
What Life Would Be Like From A Different Perspective (saltyvixenstories.com)What Life Would Be Like From A Different Perspective (saltyvixenstories.com)
What Life Would Be Like From A Different Perspective (saltyvixenstories.com)Salty Vixen Stories & More
 
ECOLUXE pre-ESPYS Ultimate Sports Lounge 2024
ECOLUXE pre-ESPYS Ultimate Sports Lounge 2024ECOLUXE pre-ESPYS Ultimate Sports Lounge 2024
ECOLUXE pre-ESPYS Ultimate Sports Lounge 2024Durkin Entertainment LLC
 
Aesthetic Design Inspiration by Slidesgo.pptx
Aesthetic Design Inspiration by Slidesgo.pptxAesthetic Design Inspiration by Slidesgo.pptx
Aesthetic Design Inspiration by Slidesgo.pptxsayemalkadripial4
 
THE MEDIC, A STORY for entertainment.docx
THE MEDIC, A STORY for entertainment.docxTHE MEDIC, A STORY for entertainment.docx
THE MEDIC, A STORY for entertainment.docxazuremorn
 
Bald Philosopher, a story for entertainment.docx
Bald Philosopher, a story for entertainment.docxBald Philosopher, a story for entertainment.docx
Bald Philosopher, a story for entertainment.docxazuremorn
 
Uk-NO1 Amil In Karachi Best Amil In Karachi Bangali Baba In Karachi Aamil In ...
Uk-NO1 Amil In Karachi Best Amil In Karachi Bangali Baba In Karachi Aamil In ...Uk-NO1 Amil In Karachi Best Amil In Karachi Bangali Baba In Karachi Aamil In ...
Uk-NO1 Amil In Karachi Best Amil In Karachi Bangali Baba In Karachi Aamil In ...Amil baba
 
Princess Jahan's Tuition Classes, a story for entertainment
Princess Jahan's Tuition Classes, a story for entertainmentPrincess Jahan's Tuition Classes, a story for entertainment
Princess Jahan's Tuition Classes, a story for entertainmentazuremorn
 

Recently uploaded (20)

Fight Scene Storyboard (Action/Adventure Animation)
Fight Scene Storyboard (Action/Adventure Animation)Fight Scene Storyboard (Action/Adventure Animation)
Fight Scene Storyboard (Action/Adventure Animation)
 
Flying Avocado Cat Cryptocurrency Created, Coded, Generated and Named by Grok...
Flying Avocado Cat Cryptocurrency Created, Coded, Generated and Named by Grok...Flying Avocado Cat Cryptocurrency Created, Coded, Generated and Named by Grok...
Flying Avocado Cat Cryptocurrency Created, Coded, Generated and Named by Grok...
 
A Spotlight on Darla Leigh Pittman Rodgers: Aaron Rodgers' Mother
A Spotlight on Darla Leigh Pittman Rodgers: Aaron Rodgers' MotherA Spotlight on Darla Leigh Pittman Rodgers: Aaron Rodgers' Mother
A Spotlight on Darla Leigh Pittman Rodgers: Aaron Rodgers' Mother
 
S10_E02_How to Pimp Social Media 101.pptx
S10_E02_How to Pimp Social Media 101.pptxS10_E02_How to Pimp Social Media 101.pptx
S10_E02_How to Pimp Social Media 101.pptx
 
NO1 Certified Black magic specialist,Expert in Pakistan Amil Baba kala ilam E...
NO1 Certified Black magic specialist,Expert in Pakistan Amil Baba kala ilam E...NO1 Certified Black magic specialist,Expert in Pakistan Amil Baba kala ilam E...
NO1 Certified Black magic specialist,Expert in Pakistan Amil Baba kala ilam E...
 
Statement Of Intent - - Copy.documentfile
Statement Of Intent - - Copy.documentfileStatement Of Intent - - Copy.documentfile
Statement Of Intent - - Copy.documentfile
 
NO1 Certified kala ilam Expert In Peshwar Kala Jadu Specialist In Peshwar Kal...
NO1 Certified kala ilam Expert In Peshwar Kala Jadu Specialist In Peshwar Kal...NO1 Certified kala ilam Expert In Peshwar Kala Jadu Specialist In Peshwar Kal...
NO1 Certified kala ilam Expert In Peshwar Kala Jadu Specialist In Peshwar Kal...
 
Behind the Scenes The Life of Enzo Zelocchi, a Hollywood Film Producer.pdf
Behind the Scenes The Life of Enzo Zelocchi, a Hollywood Film Producer.pdfBehind the Scenes The Life of Enzo Zelocchi, a Hollywood Film Producer.pdf
Behind the Scenes The Life of Enzo Zelocchi, a Hollywood Film Producer.pdf
 
Taken Pilot Episode Story pitch Document
Taken Pilot Episode Story pitch DocumentTaken Pilot Episode Story pitch Document
Taken Pilot Episode Story pitch Document
 
Sincerely, The Friday Club - Farewell Quiz-Finals.pptx
Sincerely, The Friday Club - Farewell Quiz-Finals.pptxSincerely, The Friday Club - Farewell Quiz-Finals.pptx
Sincerely, The Friday Club - Farewell Quiz-Finals.pptx
 
Biswanath Byam Samiti Open Quiz 2022 by Qui9 Grand Finale
Biswanath Byam Samiti Open Quiz 2022 by Qui9 Grand FinaleBiswanath Byam Samiti Open Quiz 2022 by Qui9 Grand Finale
Biswanath Byam Samiti Open Quiz 2022 by Qui9 Grand Finale
 
What Life Would Be Like From A Different Perspective (saltyvixenstories.com)
What Life Would Be Like From A Different Perspective (saltyvixenstories.com)What Life Would Be Like From A Different Perspective (saltyvixenstories.com)
What Life Would Be Like From A Different Perspective (saltyvixenstories.com)
 
ECOLUXE pre-ESPYS Ultimate Sports Lounge 2024
ECOLUXE pre-ESPYS Ultimate Sports Lounge 2024ECOLUXE pre-ESPYS Ultimate Sports Lounge 2024
ECOLUXE pre-ESPYS Ultimate Sports Lounge 2024
 
Aesthetic Design Inspiration by Slidesgo.pptx
Aesthetic Design Inspiration by Slidesgo.pptxAesthetic Design Inspiration by Slidesgo.pptx
Aesthetic Design Inspiration by Slidesgo.pptx
 
THE MEDIC, A STORY for entertainment.docx
THE MEDIC, A STORY for entertainment.docxTHE MEDIC, A STORY for entertainment.docx
THE MEDIC, A STORY for entertainment.docx
 
Bald Philosopher, a story for entertainment.docx
Bald Philosopher, a story for entertainment.docxBald Philosopher, a story for entertainment.docx
Bald Philosopher, a story for entertainment.docx
 
Uk-NO1 Amil In Karachi Best Amil In Karachi Bangali Baba In Karachi Aamil In ...
Uk-NO1 Amil In Karachi Best Amil In Karachi Bangali Baba In Karachi Aamil In ...Uk-NO1 Amil In Karachi Best Amil In Karachi Bangali Baba In Karachi Aamil In ...
Uk-NO1 Amil In Karachi Best Amil In Karachi Bangali Baba In Karachi Aamil In ...
 
S10_E06-Sincerely,The Friday Club- Prelims Farewell Quiz.pptx
S10_E06-Sincerely,The Friday Club- Prelims Farewell Quiz.pptxS10_E06-Sincerely,The Friday Club- Prelims Farewell Quiz.pptx
S10_E06-Sincerely,The Friday Club- Prelims Farewell Quiz.pptx
 
Princess Jahan's Tuition Classes, a story for entertainment
Princess Jahan's Tuition Classes, a story for entertainmentPrincess Jahan's Tuition Classes, a story for entertainment
Princess Jahan's Tuition Classes, a story for entertainment
 
Moveable Feast_Travel-Lifestyle-Culture Quiz.pptx
Moveable Feast_Travel-Lifestyle-Culture Quiz.pptxMoveable Feast_Travel-Lifestyle-Culture Quiz.pptx
Moveable Feast_Travel-Lifestyle-Culture Quiz.pptx
 

DirectX 11 Rendering in Battlefield 3

  • 1. v4 DirectX 11 Rendering in Battlefield 3 Johan Andersson, Rendering Architect, DICE
  • 2. Agenda Overview Feature: Deferred Shading Compute Shader Tile-Based Lighting Terrain Displacement Mapping Direct Stereo 3D rendering Quality: Antialiasing: MSAA Antialiasing: FXAA Antialiasing: SRAA Transparency Supersampling Performance: Instancing Parallel dispatch Multi-GPU Resource Streaming Conclusions Q & A
  • 4. Battlefield 3 FPS Fall 2011 DX11, Xbox 360 and PS3 Frostbite 2 engine
  • 5. Frostbite 2 Developed for Battlefield 3 and future DICE/EA games Massive focus on creating simple to use & powerful workflows Major pushes in animation, destruction, streaming, rendering, lightingand landscapes
  • 6. DX11 DX11 API only Requires a DX10 or DX11 GPUs Requires Vista SP1 or Windows 7 No Windows XP! Why? CPU performance win GPU performance & quality win Ease ofdevelopment - no legacy Future proof BF3 is a big title - will drive OS & HW adoption Which is good for your game as well! 
  • 7. Options for rendering Switched to Deferred Shading in FB2 Rich mix of Outdoor + Indoor + Urban environments in BF3 Wanted lots more light sources Why not Forward Rendering? Light culling / shader permutations not efficient for us Expensive & more difficultdecaling / destruction masking Why not Light Pre-pass? 2x geometry pass too expensive on both CPU & GPU for us Was able to generalize our BRDF enough to just a few variations Saw major potential in full tile-based deferred shading See also: Nicolas Thibieroz’s talk ”Deferred Shading Optimizations”
  • 8. Deferred Shading Weaknesses with traditional deferred lighting/shading: Massive overdraw & ROP cost when having lots of big light sources Expensive to have multiple per-pixel materials in light shaders MSAA lighting can be slow (non-coherent, extra BW)
  • 10. Tile-based Deferred Shading 1. Divide screen into tiles and determine which lights affects which tiles 2. Only apply the visible light sources on pixels Custom shader with multiple lights Reduced bandwidth & setup cost How can we do this best in DX11?
  • 11. Lighting with Compute Shader Tile-based Deferred Shading using Compute Shaders Primarily for analytical light sources Point lights, cone lights, line lights No shadows Requires Compute Shader 5.0 Hybrid Graphics/Compute shading pipeline: Graphics pipeline rasterizes gbuffers for opaque surfaces Compute pipeline uses gbuffers, culls lights, computes lighting & combines with shading Graphics pipeline renders transparent surfaces on top
  • 12. CS requirements & setup 1 thread per pixel, 16x16 thread groups (aka tile) Input: gbuffers, depth buffer & list oflights Output: fully composited & lit HDR texture Normal Roughness Texture2D<float4> gbufferTexture0 : register(t0); Texture2D<float4> gbufferTexture1 : register(t1); Texture2D<float4> gbufferTexture2 : register(t2); Texture2D<float4> depthTexture : register(t3); RWTexture2D<float4> outputTexture : register(u0); #define BLOCK_SIZE 16 [numthreads(BLOCK_SIZE,BLOCK_SIZE,1)] void csMain( uint3 groupId : SV_GroupID, uint3 groupThreadId : SV_GroupThreadID, uint groupIndex: SV_GroupIndex, uint3 dispatchThreadId : SV_DispatchThreadID) { ... } Diffuse Albedo Specular Albedo
  • 13. groupshared uint minDepthInt; groupshared uint maxDepthInt; // --- globals above, function below ------- float depth = depthTexture.Load(uint3(texCoord, 0)).r; uint depthInt = asuint(depth); minDepthInt = 0xFFFFFFFF; maxDepthInt = 0; GroupMemoryBarrierWithGroupSync(); InterlockedMin(minDepthInt, depthInt); InterlockedMax(maxDepthInt, depthInt); GroupMemoryBarrierWithGroupSync(); float minGroupDepth = asfloat(minDepthInt); float maxGroupDepth = asfloat(maxDepthInt); CS steps 1-2 1. Load gbuffers & depth 2. Calculate min & max z in threadgroup / tile Using InterlockedMin/Max on groupshared variable Atomics only work on ints  Can cast float to int (z is always +)
  • 14. CS step 3 – Culling Determine visible light sources for each tile Cull all light sources against tile frustum Input (global): Light list, frustum& SW occlusionculled Output (per tile): # of visible light sources Index list of visible light sources Per-tile visible light count (black = 0 lights, white = 40)
  • 15. struct Light { float3 pos; float sqrRadius; float3 color; float invSqrRadius; }; int lightCount; StructuredBuffer<Light> lights; groupshared uint visibleLightCount = 0; groupshared uint visibleLightIndices[1024]; // --- globals above, cont. function below --- uint threadCount = BLOCK_SIZE*BLOCK_SIZE; uint passCount = (lightCount+threadCount-1) / threadCount; for (uint passIt = 0; passIt < passCount; ++passIt) { uint lightIndex = passIt*threadCount + groupIndex; // prevent overrun by clamping to a last ”null” light lightIndex = min(lightIndex, lightCount); if (intersects(lights[lightIndex], tile)) { uint offset; InterlockedAdd(visibleLightCount, 1, offset); visibleLightIndices[offset] = lightIndex; } } GroupMemoryBarrierWithGroupSync(); 3a. Each thread switches to process lights instead of pixels Wow, parallelism switcharoo! 256 light sources in parallel Multiple iterations for >256 lights 3b. Intersect light and tile Multiple variants – accuracy vsperf Tile min & max z is used as a ”depth bounds” test 3c. Append visible light indices to list Atomic add to threadgroup shared memory ”inlined stream compaction” 3d. Switch back to processing pixels Synchronize the thread group We now know which light sources affect the tile CS step 3 – Impl
  • 16. CS deferred shading final steps 4. For each pixel, accumulate lighting from visible lights Read from tile visible light index list in groupshared memory 5. Combine lighting & shadingalbedos Output is non-MSAA HDR texture Render transparent surfaces on top Computed lighting float3 color = 0; for (uintlightIt = 0; lightIt < visibleLightCount; ++lightIt) { uintlightIndex = visibleLightIndices[lightIt]; Lightlight = lights[lightIndex]; color += diffuseAlbedo * evaluateLightDiffuse(light, gbuffer); color += specularAlbedo * evaluateLightSpecular(light, gbuffer); }
  • 17. Massive lighting test scene - 1000 large point lights GDC 2011 test content
  • 18. MSAA Compute Shader Lighting Only edge pixels need full per-sample lighting But edges have bad screen-space coherency! Inefficient Compute Shader can build efficient coherent pixel list Evaluate lighting for each pixel (sample 0) Determine if pixel requires per-sample lighting If so, add to atomic list in shared memory When all pixels are done, synchronize Go through and light sample 1-3 for pixels in list Major performance improvement! Described in detail in [Lauritzen10]
  • 20. Terrain rendering Battlefield 3 terrains Huge area & massive view distances Dynamic destructible heightfields Procedural virtual texturing Streamed heightfields, colormaps, masks Full details at at a later conference We stream in source heightfield data at close to pixel ratio Derive high-quality per-pixel normals in shader How can we increase detail even further on DX11? Create better silhouettes and improved depth Keep small-scale detail (dynamic craters & slopes)
  • 21. >
  • 24. Terrain Displacement Mapping Straight high-res heightfields, no procedural detail Lots of data in the heightfields Pragmatic & simple choice No changes in physics/collisions No content changes, artists see the true detail they created Uses DX11 fixed edge tessellation factors Stable, no swimming vertices Though can be wasteful Height morphing for streaming by fetching 2 heightfields in domain shader & blend based on patch CLOD factor More work left to figure optimal tessellation scheme for our use case
  • 25. Stereo 3D rendering in DX11 Nvidia’s 3D Visiondrivers is a good and almost automatic stereo 3D rendering method But only for forward rendering, doesn’t work with deferred shading Or on AMD or Intel GPUs Transparent surfaces do not get proper 3D depth We instead use explicit 3D stereo rendering Render unique frame for each eye Works with deferred shading & includes all surfaces Higher performance requirements, 2x draw calls Works with Nvidia’s 3D Vision and AMD’s HD3D Similar to OpenGL quad buffer support Ask your friendly IHV contact how
  • 27. Instancing Draw calls can still be major performance bottleneck Lots of materials / lots of variation Complex shadowmaps High detail / long view distances Full 3D stereo rendering Battlefield have lots of use cases for heavy instancing Props, foliage, debris, destruction, mesh particles Batching submissions is still important, just as before! Richard Huddy: ”Batch batch batch!”
  • 28. Instancing in DirectX DX9-style stream instancing is good, but restrictive Extra vertex attributes, GPU overhead Can’t be (efficiently) combined with skinning Used primarily for tiny meshes (particles, foliage) DX10/DX11 brings support for shader Buffer objects Vertex shaders have access to SV_InstanceID Can do completely arbitrary loads, not limited to fixed elements Can support per-instance arrays and other data structures! Let’s rethink how instancing can be implemented..
  • 29. Instancing data Multiple object types Rigid / skinned / composite meshes Multiple object lighting types Small/dynamic: light probes Large/static: light maps Different types of instancing data we have Transform float4x3 Skinning transforms float4x3 array SH light probe float4 x 4 Lightmap UV scale/offset float4 Let’s pack all instancing data into single big buffer!
  • 30. Buffer<float4> instanceVectorBuffer : register(t0); cbuffera { float g_startVector; float g_vectorsPerInstance; } VsOutputmain( // .... uint instanceId : SV_InstanceId) { uint worldMatrixVectorOffset = g_startVector + input.instanceId * g_vectorsPerInstance + 0; uint probeVectorOffset = g_startVector + input.instanceId * g_vectorsPerInstance + 3; float4 r0 = instanceVectorBuffer.Load(worldMatrixVectorOffset + 0); float4 r1 = instanceVectorBuffer.Load(worldMatrixVectorOffset + 1); float4 r2 = instanceVectorBuffer.Load(worldMatrixVectorOffset + 2); float4 lightProbeShR = instanceVectorBuffer.Load(probeVectorOffset + 0); float4 lightProbeShG = instanceVectorBuffer.Load(probeVectorOffset + 1); float4 lightProbeShB = instanceVectorBuffer.Load(probeVectorOffset + 2); float4 lightProbeShO = instanceVectorBuffer.Load(probeVectorOffset + 3); // .... } Instancing example: transform + SH
  • 31. half4 weights = input.boneWeights; int4 indices = (int4)input.boneIndices; float4 skinnedPos = mul(float4(pos,1), getSkinningMatrix(indices[0])).xyz * weights[0]; skinnedPos += mul(float4(pos,1), getSkinningMatrix(indices[1])).xyz * weights[1]; skinnedPos += mul(float4(pos,1), getSkinningMatrix(indices[2])).xyz * weights[2]; skinnedPos += mul(float4(pos,1), getSkinningMatrix(indices[3])).xyz * weights[3]; // ... float4x3 getSkinningMatrix(uintboneIndex) { uintvectorOffset = g_startVector + instanceId * g_vectorsPerInstance; vectorOffset += boneIndex*3; float4 r0 = instanceVectorBuffer.Load(vectorOffset + 0); float4 r1 = instanceVectorBuffer.Load(vectorOffset + 1); float4 r2 = instanceVectorBuffer.Load(vectorOffset + 2); return createMat4x3(r0, r1, r2); } Instancing example: skinning
  • 32. Instancing benefits Single draw call per object type instead of per instance Minor GPU hit for big CPU gain Instancing does not break when skinning parts More deterministic & better overall performance End result is typically 1500-2000 draw calls Regardless of how many object instances the artists place! Instead of 3000-7000 draw calls in some heavy cases
  • 33. Parallel Dispatch in Theory Great key DX11 feature! Improve performance by scaling dispatching to D3D to more cores Reduce frame latency How we use it: DX11 deferred context per HW thread Renderer builds list of all draw calls we want to do for each rendering ”layer” of the frame Split draw calls for each layer into chunks of ~256 Dispatch chunks in parallel to the deferred contexts to generate command lists Render to immediate context & execute command lists Profit! * * but theory != practice
  • 34. Parallel Dispatch in Practice Still no performant drivers available for our use case  Have waited for 2 years and still are Big driver codebases takes time to refactor IHVs vs Microsoft quagmire Heavy driver threads collide with game threads How it should work (an utopia?) Driver does not create any processing threads of its own Game submits workload in parallel to multiple deferred contexts Driver make sure almost all processing required happens on the draw call on the deferred context Game dispatches command list on immediate context, driver does absolute minimal work with it Still good to design engine for + instancing is great! quagmire [ˈkwægˌmaɪə ˈkwɒg-]n 1. (Earth Sciences / Physical Geography) a soft wet area of land that gives way under the feet; bog 2. an awkward, complex, or embarrassing situation
  • 35. Resource streaming Even with modern GPUs with lots of memory, resource streaming is often required Can’t require 1+ GB graphics cards BF3 levels have much more than 1 GB of textures & meshes Reduced load times But creating & destroying DX resources in-frame has never been a good thing Can cause non-deterministic & large driver / OS stalls  Has been a problem for a very long time in DX About time to fix it
  • 36. DX11 Resource Streaming Have worked with Microsoft, Nvidia & AMD to make sure we can do stall free async resource streaming of GPU resources in DX11 Want neither CPU nor GPU perf hit Key foundation: DX11 concurrent creates Resource creation flow: Streaming system determines resources toload (texturemipmaps or meshLODs) Add up DX resource creation on to queue on our own separate low-priority thread Thread creates resources using initial data, signals streaming system Resource created, game starts using it Enablesasync stall-free DMA in drivers! Resource destruction flow: Streaming system deletes D3D resource Driver keeps it internally alive until GPU frames using it are done. NO STALL! D3D11_FEATURE_DATA_THREADING threadingCaps; FB_SAFE_DX(m_device->CheckFeatureSupport( D3D11_FEATURE_THREADING, &threadingCaps, sizeof(threadingCaps))); if (threadingCaps.DriverConcurrentCreates)
  • 37. Multi-GPU Efficiently supporting Crossfire and SLI is important for us High-end consumers expect it IHVs expect it (and can help!) Allows targeting higher-end HW then currently available during dev AFR is easy: Do not reuse GPU resources from previous frame! UpdateSubResourceis easy & robust to use for dynamic resources, but not ideal All of our playtests run with exe named AFR-FriendlyD3D.exe Disables all driver AFR synchronization workarounds Rather find corruption during dev then have bad perf ForceSingleGPU.exe is also useful to track down issues
  • 39. Antialiasing Reducing aliasing is one of our key visual priorities Creates a more smooth gameplay experience Extra challenging goal due to deferred shading We use multiple methods: MSAA –Multisample Antialiasing FXAA – Fast Approximate Antialiasing SRAA – Sub-pixel Reconstruction Antialiasing TSAA – Transparency Supersampling Antialiasing Aliasing
  • 40. MSAA Our solution: Deferred geometry pass renders with MSAA (2x, 4x or 8x) Light shaders evaluate per-sample (when needed), averages the samples and writes out per-pixel Transparent surfaces rendered on top without MSAA 1080p gbuffer+z with 4x MSAA is 158 MB Lots of memory and lots of bandwidth  Could be tiled to reduce memory usage Very nice quality though  Our (overall) highest quality option But not fast enough for more GPUs Need additional solution(s)..
  • 41. FXAA ”Fast Approximate Antialiasing” GPU-based MLAA implementation by Timothy Lottes (Nvidia) Multiple quality options ~1.3 ms/f for 1080p on Geforce 580 Pros & cons: Superb antialiased long edges!  Smooth overall picture  Reasonably fast  Moving pictures do not benefit as much  ”Blurry aliasing”  Will be released here at GDC’11 Part of Nvidia’s example SDK
  • 42. SRAA ”Sub-pixel Reconstruction Antialiasing” Presented at I3D’11 2 weeks ago [Chajdas11] Use 4x MSAA buffers to improve reconstruction Multiple variants: MSAA depth buffer MSAA depth buffer + normal buffer MSAA Primitive ID / spatial hashing buffer Pros: Better at capturing small scale detail  Less ”pixel snapping” than MLAA variants  Cons: Extra MSAA z/normal/id pass can be prohibitive  Integration not as easy due to extra pass 
  • 43.
  • 48. FXAA
  • 50. MSAA Sample Coverage None of the AA solutions can solve all aliasing Foliage & other alpha-tested surfaces are extra difficult cases Undersampled geometry, requires sub-samples DX 10.1 added SV_COVERAGE as a pixel shader output DX 11 added SV_COVERAGE as a pixel shader input What does this mean? We get full programmable control over the coverage mask No need to waste the alpha channel output (great for deferred) We can do partial supersampling on alpha-tested surfaces!
  • 51. Transparency Supersampling static const float2 msaaOffsets[4] = { float2(-0.125, -0.375), float2(0.375, -0.125), float2(-0.375, 0.125), float2(0.125, 0.375) }; void psMain( out float4 color : SV_Target, out uint coverage : SV_Coverage) { float2 texCoord_ddx = ddx(texCoord); float2 texCoord_ddy = ddy(texCoord); coverage = 0; [unroll] for (int i = 0; i < 4; ++i) { float2 texelOffset = msaaOffsets[i].x * texCoord_ddx; texelOffset += msaaOffsets[i].y * texCoord_ddy; float4 temp = tex.SampleLevel(sampler, texCoord + texelOffset); if (temp.a >= 0.5) coverage |= 1<<i; } } Shade per-pixel but evaluate alpha test per-sample Write out coverage bitmask MSAA offsets are defined in DX 10.1 Requires shader permutation for each MSAA level Gradients still quite limited But much better than standard MSAA!  Can combine with screen-space dither See also: DirectX SDK ’TransparencyAA10.1 GDC’09 STALKER talk [Lobanchikov09]
  • 52. Alpha testing 4x MSAA + Transparency Supersampling
  • 53. Conclusions DX11 is here – in force 2011 is a great year to focus on DX11 2012 will be a great year for more to drop DX9 We’ve found lots & lots of quality & performance enhancing features using DX11 And so will you for your game! Still have only started, lots of potential Take advantage of the PC strengths, don’t hold it back Big end-user value Good preparation for Gen4
  • 54. Thanks Christina Coffin (@ChristinaCoffin) Mattias Widmark Kenny Magnusson Colin Barré-Brisebois (@ZigguratVertigo) Timothy Lottes (@TimothyLottes) Matthäus G. Chajdas (@NIV_Anteru) Miguel Sainz Nicolas Thibieroz Battlefield team Frostbite team Microsoft Nvidia AMD Intel
  • 55. Questions? Email: repi@dice.se Blog: http://repi.se Twitter: @repi Battlefield 3 & Frostbite 2 talks at GDC’11: For more DICE talks: http://publications.dice.se
  • 56. References [Lobanchikov09] Igor A. Lobanchikov, ”GSC Game World’s STALKER: Clear Sky – a showcase for Direct3D 10.0/1” GDC’09. http://developer.amd.com/gpu_assets/01gdc09ad3ddstalkerclearsky210309.ppt [Lauritzen10] Andrew Lauritzen, ”Deferred Rendering for Current and Future Rendering Pipelines” SIGGRAPH’10 http://bps10.idav.ucdavis.edu/ [Chajdas11] Matthäus G. Chajdas et al ”Subpixel Reconstruction Antialiasing for Deferred Shading.”. I3D’11