High Performance in Broad Reach Games Chas. Boyd

Slides:



Advertisements
Similar presentations
Introduction to Direct3D 10 Course Porting Game Engines to Direct3D 10: Crysis / CryEngine2 Carsten Wenzel.
Advertisements

DirectX11 Performance Reloaded
DirectX Graphics: Direct3D 10 and Beyond
CS 4731: Computer Graphics Lecture 20: Raster Graphics Part 1 Emmanuel Agu.
COMPUTER GRAPHICS CS 482 – FALL 2014 NOVEMBER 10, 2014 GRAPHICS HARDWARE GRAPHICS PROCESSING UNITS PARALLELISM.
GlTF and rest3d Patrick Cozzi University of Pennsylvania CIS Fall 2013.
Lecture 38: Chapter 7: Multiprocessors Today’s topic –Vector processors –GPUs –An example 1.
Status – Week 257 Victor Moya. Summary GPU interface. GPU interface. GPU state. GPU state. API/Driver State. API/Driver State. Driver/CPU Proxy. Driver/CPU.
RealityEngine Graphics Kurt Akeley Silicon Graphics Computer Systems.
G30™ A 3D graphics accelerator for mobile devices Petri Nordlund CTO, Bitboys Oy.
Real-Time Rendering TEXTURING Lecture 02 Marina Gavrilova.
ABC HFG JKLW OPQR NTU VS YZ.
Week 7 - Wednesday.  What did we talk about last time?  Transparency  Gamma correction  Started texturing.
GRAPHICS AND COMPUTING GPUS Jehan-François Pâris
Rasterization and Ray Tracing in Real-Time Applications (Games) Andrew Graff.
1 Shader Performance Analysis on a Modern GPU Architecture Victor Moya, Carlos González, Jordi Roca, Agustín Fernández Jordi Roca, Agustín Fernández Department.
© David Kirk/NVIDIA and Wen-mei W. Hwu, ECE408, University of Illinois, Urbana-Champaign 1 Programming Massively Parallel Processors Chapter.
IN4151 Introduction 3D graphics 1 Introduction to 3D computer graphics part 2 Viewing pipeline Multi-processor implementation GPU architecture GPU algorithms.
GPU Simulator Victor Moya. Summary Rendering pipeline for 3D graphics. Rendering pipeline for 3D graphics. Graphic Processors. Graphic Processors. GPU.
Status – Week 260 Victor Moya. Summary shSim. shSim. GPU design. GPU design. Future Work. Future Work. Rumors and News. Rumors and News. Imagine. Imagine.
University of Texas at Austin CS 378 – Game Technology Don Fussell CS 378: Computer Game Technology Beyond Meshes Spring 2012.
You can use 3D graphics to enhance and differentiate your Metro style app.
Computer Graphics Introducing DirectX
GPU Programming Robert Hero Quick Overview (The Old Way) Graphics cards process Triangles Graphics cards process Triangles Quads.
CHAPTER 4 Window Creation and Control © 2008 Cengage Learning EMEA.
Chas. Boyd Principal PM Microsoft OSG Graphics
Real-time Graphical Shader Programming with Cg (HLSL)
4.7. I NSTANCING Introduction to geometry instancing.
Chris Kerkhoff Matthew Sullivan 10/16/2009.  Shaders are simple programs that describe the traits of either a vertex or a pixel.  Shaders replace a.
UW EXTENSION CERTIFICATE PROGRAM IN GAME DEVELOPMENT 2 ND QUARTER: ADVANCED GRAPHICS Textures.
Interactive Time-Dependent Tone Mapping Using Programmable Graphics Hardware Nolan GoodnightGreg HumphreysCliff WoolleyRui Wang University of Virginia.
A Crash Course in HLSL Matt Christian.
4/23/2017 4:23 AM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
CS 450: COMPUTER GRAPHICS REVIEW: INTRODUCTION TO COMPUTER GRAPHICS – PART 2 SPRING 2015 DR. MICHAEL J. REALE.
Week 2 - Friday.  What did we talk about last time?  Graphics rendering pipeline  Geometry Stage.
The Graphics Rendering Pipeline 3D SCENE Collection of 3D primitives IMAGE Array of pixels Primitives: Basic geometric structures (points, lines, triangles,
CHAPTER TEN AUTHORING.
OpenGL ES Performance (and Quality) on the GoForce5500 Handheld GPU Lars M. Bishop, NVIDIA Developer Technologies.
1 Introduction to Computer Graphics SEN Introduction to OpenGL Graphics Applications.
Tone Mapping on GPUs Cliff Woolley University of Virginia Slides courtesy Nolan Goodnight.
Ritual ™ Entertainment: Next-Gen Effects on Direct3D ® 10 Sam Z. Glassenberg Program Manager Microsoft ® – Direct3D ® Doug Service Director of Technology.
Xbox MB system memory IBM 3-way symmetric core processor ATI GPU with embedded EDRAM 12x DVD Optional Hard disk.
Computer Graphics 3 Lecture 6: Other Hardware-Based Extensions Benjamin Mora 1 University of Wales Swansea Dr. Benjamin Mora.
© David Kirk/NVIDIA and Wen-mei W. Hwu, ECE408, University of Illinois, Urbana-Champaign 1 Programming Massively Parallel Processors Lecture.
Emerging Technologies for Games Capability Testing and DirectX10 Features CO3301 Week 6.
Ray Tracing using Programmable Graphics Hardware
Advanced D3D10 Shader Authoring Presentation/Presenter Title Slide.
GPU Computing for GIS James Mower Department of Geography and Planning University at Albany.
An Introduction to the Cg Shading Language Marco Leon Brandeis University Computer Science Department.
Postmortem: Deferred Shading in Tabula Rasa Rusty Koonce NCsoft September 15, 2008.
COMP 175 | COMPUTER GRAPHICS Remco Chang1/XX13 – GLSL Lecture 13: OpenGL Shading Language (GLSL) COMP 175: Computer Graphics April 12, 2016.
How to use a Pixel Shader CMT3317. Pixel shaders There is NO requirement to use a pixel shader for the coursework though you can if you want to You should.
What is DirectX? DirectX is built by Microsoft as a collection of API’s (Application Programming Interfaces) for the purpose of multimedia processing.
Computer Engg, IIT(BHU)
GPU Architecture and Its Application
COMPUTER GRAPHICS CHAPTER 38 CS 482 – Fall 2017 GRAPHICS HARDWARE
Computer Graphics Lecture 32
Build /24/2018 © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
Introduction to OpenGL
Chapter 6 GPU, Shaders, and Shading Languages
A lap around DirectX game development tools
The Graphics Rendering Pipeline
Certifying graphics experiences on Windows 8
Introduction to geometry instancing
RADEON™ 9700 Architecture and 3D Performance
Computer Graphics Introduction to Shaders
CIS 441/541: Introduction to Computer Graphics Lecture 15: shaders
03 | Creating, Texturing and Moving Objects
Introduction to OpenGL
CIS 6930: Chip Multiprocessor: GPU Architecture and Programming
Presentation transcript:

High Performance in Broad Reach Games Chas. Boyd Principal Program Manager Microsoft Corporation

High Performance in Broad Reach Games The more polished the game, the larger the revenue opportunity. This talk covers techniques to give your app a professsional appeal using modern features for a fluid experience. Learn how to expand your audience by leveraging capabilities across the entire range of Windows8 PCs, including languages, tools, and APIs for high-performance graphics.

Agenda Windows 8 hardware diversity A unified 3D API to access the power of the GPU Designing for the Broadest Reach Optimizing Performance Tile-based rendering optimizations Recommendations

3 Presentations Today Step by Step through Game Development How to set up the game How to code it How to optimize it <- You are here

Windows 8 PC Hardware Diversity

GPU Hardware Evolution Year Version Defining Feature 1996 DirectX3 Hardware rasterization 1997 DirectX5 2 Shading options to choose from 1998 DirectX6 Multi-texture operations 1999 DirectX7 Vertex Processing in hardware 2000 DirectX8 Programmable Shaders: Vertex and Pixel 2001 DirectX8.1 Longer shaders 2002 DirectX9 High Level Shading Language, 32 instr 2003 DirectX9c 1000s of instructions per shader 2006 DirectX10 Geometry shader, Consistent shader models 2009 DirectX11 Compute Shader, Tessellation

After Before DirectX

DirectX9 Hardware Vertex shaders Pixel shaders 8 Textures 4 Render Targets Cube maps Volume textures Anisotropic filtering Antialiasing HDR rendering Texture compression

DirectX 10 Hardware Vertex shaders Geometry shaders Pixel shaders 8 Textures 4 Render Targets Cube maps Volume textures Anisotropic filtering Antialiasing HDR rendering Texture compression Geometry shaders Stream out 128 Textures per shader 8 Render Targets Integers in shaders Vertex textures Shader sampling Constant buffers Alpha-to-coverage Basic DirectCompute Async resource creation

DirectX 11 Hardware Vertex shaders Pixel shaders 8 Textures 4 Render Targets Cube maps Volume textures Anisotropic filtering Antialiasing HDR rendering Texture compression Geometry shaders Stream out 128 Textures per shader 8 Render Targets Integers in shaders Vertex textures Shader sampling Constant buffers Alpha-to-coverage Basic DirectCompute Async resource creation Full DirectCompute Random access writes Tessellation shaders New compression formats Shader linkage

Feature Levels Direct3D 11 provides a uniform interface to access hardware capabilities Feature Levels map to hardware capabilities Feature_Level_9  DirectX 9 Hardware Feature_Level_10  DirectX 10 Hardware Feature_Level_11  DirectX 11 Hardware

Select Feature Levels to Support D3D_FEATURE_LEVEL featureLevels[] = { D3D_FEATURE_LEVEL_11_1, D3D_FEATURE_LEVEL_11_0, D3D_FEATURE_LEVEL_10_1, D3D_FEATURE_LEVEL_10_0, D3D_FEATURE_LEVEL_9_3, D3D_FEATURE_LEVEL_9_1 }; UINT creationFlags = D3D11_CREATE_DEVICE_BGRA_SUPPORT; © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Create the Device and Context ComPtr<ID3D11Device> device; ComPtr<ID3D11DeviceContext> context; D3D11CreateDevice( nullptr, // use the default adapter D3D_DRIVER_TYPE_HARDWARE, 0, // use 0 unless a software device creationFlags, // defined above featureLevels, // what app will support ARRAYSIZE(featureLevels), D3D11_SDK_VERSION, // should always be D3D11_SDK_VERSION &device, // created device &m_featureLevel, // feature level of the device &context // corresponding immediate context ); © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Development Strategy Develop on DirectX 11 hardware Target Feature_Level_9 and scale up Include calibration code in game to dynamically configure for current hardware Be aware of Feature Level differences Test by restricting Feature Level Test on multiple PCs

DirectX Control Panel

Chapter 1/4 Balancing Act

Features vs Performance © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Opposing Directions Prune features and image quality to meet performance goals on low-end hardware Add features and image quality to differentiate your app on high-end hardware

Development Strategy Develop on DirectX 11 hardware Target Feature_Level_9 and scale up Include calibration code in game to dynamically configure for current hardware Adjust to maintain performance Be aware of Feature Level differences Test by restricting Feature Level Test on multiple PCs

Differentiation Increase Visual Quality Higher resolution textures Use bump maps

Texture Quality Control Balance visual quality with performance Scale back on size via mipmap levels Use block-compressed texture formats Loader code skips mip levels 1024 x 1024 512 x 512 256 x 256

Optimization Techniques Tune Anisotropic filter quality Simple scalar value MultiSampling AntiAliasing (MSAA) Reduce sample count to maintain frame rate Render to a lower resolution and scale up for final image For best image quality, do not scale 2D text Geometry Feature_Level_11 – use tessellation for more polygon count control Consider lower-resolution (lower vertex count) meshes

Basic Performance Checks Be sure you are not setting state and loading data that doesn’t change every frame Set breakpoint in the render code We’ve seen some apps drawing twice per frame Make sure that the game loop routines are still in the right order Check to see if you are CPU bound, or GPU bound. If GPU, check to see if you are fill-rate or vertex bound.

Use PIX PIX is a profiler mode for Visual Studio 11 You can use it to step-through DirectX API calls And display: event history pixel history DX rendering pipeline the DX object table, and call stacks

Chapter 3/4 More Optimizations

More Optimizations Pure performance helps low-end hardware But if image quality is not impacted, high-end hardware benefits too Minimum Precision is a new capability in Windows 8 HLSL

Minimum Precision Reduce the number of bits of precision in shader calculations Hints to the graphics driver where optimizations can be done Specifies minimum rather than actual precision min16float min12int min16int

Minimum Precision HLSL Code Sample static const float brightThreshold = 0.5f; Texture2D sourceTexture : register(t0); float4 DownScale3x3BrightPass(QuadVertexShaderOutput input) : SV_TARGET { float3 brightColor = 0; // Gather 16 adjacent pixels (each bilinear sample reads a 2x2 region) brightColor = sourceTexture.Sample(linearSampler, input.tex, int2(-1,-1)).rgb; brightColor += sourceTexture.Sample(linearSampler, input.tex, int2( 1,-1)).rgb; brightColor += sourceTexture.Sample(linearSampler, input.tex, int2(-1, 1)).rgb; brightColor += sourceTexture.Sample(linearSampler, input.tex, int2( 1, 1)).rgb; brightColor /= 4.0f; // Brightness thresholding brightColor = max(0, brightColor - brightThreshold); return float4(brightColor, 1.0f); } © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Minimum Precision HLSL Code Sample static const min16float brightThreshold = (min16float)0.5; Texture2D<min16float4> sourceTexture : register(t0); float4 DownScale3x3BrightPass(QuadVertexShaderOutput input) : SV_TARGET { min16float3 brightColor = 0; // Gather 16 adjacent pixels (each bilinear sample reads a 2x2 region) brightColor = sourceTexture.Sample(linearSampler, input.tex, int2(-1,-1)).rgb; brightColor += sourceTexture.Sample(linearSampler, input.tex, int2( 1,-1)).rgb; brightColor += sourceTexture.Sample(linearSampler, input.tex, int2(-1, 1)).rgb; brightColor += sourceTexture.Sample(linearSampler, input.tex, int2( 1, 1)).rgb; brightColor /= (min16float)4.0; // Brightness thresholding brightColor = max(0, brightColor - brightThreshold); return float4(brightColor, 1.0f); } © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Chapter 2/4 Tile –Based Rendering

Typical Rendering Command stream sent to GPU Command Stream CommandBuffer1 Command1 Command2 Command3 Command4 Command5 Command6 CommandBuffer2 CommandBuffer3 Command Stream

Tile Based Rendering Display the final image Send Command Stream to GPU Execute Command Stream for Tile 1 Execute Command Stream for Tile 2 Execute Command Stream for Tile 3 Execute Command Stream for Tile 4 CommandBuffer1 Command1 Command2 Command3 Command4 Command5 Command6 CommandBuffer2 CommandBuffer3 Buffered Commands Execute Command Stream for Tile 5 Execute Command Stream for Tile 6 Display the final image

Tile-based Rendering Strategies Avoid mid-scene flushes Avoid swapping back and forth between RenderTargets Use scissors when updating small portions of a RenderTarget Use DISCARD and NO_OVERWRITE when possible

Tile-based Rendering Optimizations GPUs with a tile-based rendering architecture can get a performance boost with a special flag: m_swapChain->Present(1, 0); // present the image on the display ComPtr<ID3D11View> view; m_renderTargetView.As(&view); // get the view on the RT m_d3dContext->DiscardView(view.Get()); // release the view

Chapter 4/4 Recommendations

Conclusion Windows 8 Runs on the broadest graphics hardware diversity ever Designed for graphics hardware acceleration Direct3D 11 is the 3D API to access the power of the GPU You can get Great Graphics Performance leveraging the GPU AND hit the broadest markets

Strategy Recap for Indie Devs Design for Feature_Level_9 Adjust at runtime for actual Feature Level Use advanced features to differentiate when available Dynamically calibrate for smooth performance Use new Direct3D 11 features to better utilize hardware Minimum precision Tile-based rendering optimizations

Time to Act Biggest opportunity. Ever. Windows 8 Consumer Preview is now available. Check out the store. Go build great games. http://dev.windows.com

Q & A

4/20/2017 8:42 AM © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.