Up Your Game Development with Performance Analyzers
Optimize Your Game Development―No Matter What Your Role― Using Intel® Graphics Performance Analyzers
Performance optimization can mean the difference between a good game and a great game. And providing that smooth playing experience can be a daunting task. But Intel® Graphics Performance Analyzers (Intel® GPA) can help streamline the process, making it possible for everyone on your development team to lend a helping hand. After reading this article, you’ll be able to pinpoint exactly where you fit into the optimization process and see how the Intel GPA tool suite can help you reach your optimization goals, like higher fidelity or better framerate.
Where Do You Fit?
There are three main types of game developers:
- Artists/designers
- Gameplay programmers
- Game engine programmers
Each of these groups plays a vital role. And each interacts with the optimization process in a different way. Let’s dive into some use cases to better understand the differences.
Artists/Designers
We’ll begin with the artists who create the assets associated with characters and the environment within the game―the scenery, objects, surface textures, vehicles, etc.
To create the best viewing experience, artists typically develop these elements with the highest fidelity in mind (4K textures and more complex geometry), but they can be scaled back during optimization. Artists work to create textures and assets that allow for smooth gameplay on the target hardware. They also work hand-in-hand with gameplay programmers to execute design ideas relating to lighting, movement, and overall design execution.
When you’re retargeting for a new minimum specification or optimizing due to inadequate framerate, you can run into issues like:
- Texture bandwidth: Textures that are too big or too high-resolution
- Geometric complexity: Polygons that are very small
Optimization tools like Intel GPA allow artists to self-check their work, ensuring that any texture or asset addition doesn’t drop the framerate below your target or cause additional gameplay issues.
Using Intel GPA, artists can determine their overall impact on any given scene by capturing a frame with the Graphics Monitor and profiling that frame in Frame Analyzer. Frame Analyzer lets artists see the effect textures and assets make by extracting pertinent metrics associated with asset geometry―like viewing total rendered primitives―as well as selecting through the different mipmap (MIP) levels associated with a texture. Using the interactive experiments like “2*2 Texture” (Figure 1), artists can determine whether a texture or object has created a bottleneck that degrades game performance and could benefit from MIP level reduction (Figure 2) using a lower resolution of a texture, or using levels of detail (LODs), meaning lowering the level of detail of an object as it moves further away from the camera. By using Intel GPA as a validator for asset creation and performance impact, artists are better able to cross-reference gameplay with the asset additions―and are more equipped to maintain high framerates with high fidelity.
Gameplay Programmers
Gameplay programmers combine the game-agnostic components created by the game engine programmers and the assets made by the artists to create the best gameplay experience possible. Their main optimization focus is on game functionality―user interface, character movement, controls, audio, etc.―while executing the artists’ designs.
During optimization, these programmers focus their attention on efficient code performance to create a good base layer for assets. The more efficient the back-end code is, the better. When these programmers use Intel GPA, the main benefit they’ll see is in live editing with playback, CPU/GPU profiling, and experiments (although this list of benefits is not exhaustive by any means).
Intel GPA offers multiple ways to determine where and when to optimize code or to optimize the way in which objects are rendered (the number of objects and batching). One common area a gameplay programmer can optimize is the shaders―depending on how small the studio is and whether there are any dedicated game engine programmers on the team. Invoking the “Simple Pixel Shader” or “1*1 Scissor Rect” (Figure 3) within the Frame Analyzer, programmers can narrow down a bottleneck to either the pixel shader or the vertex shader. With live playback and editing, they can then edit the shader within the tool or import an optimized shader and see the outcome of those changes (Figure 4). Quickly identifying the dependencies of a costly shader is also incredibly easy with the Resource History tab, which lists all events that use the selected resource. Other common areas that gameplay programmers may pay attention to include:
- How particle effects are rendered
- The lighting (reflection, number of lights, etc.)
- How objects are placed within a scene
- How draw calls are batched (dynamic batching versus static batching)
Another quick optimization is to look through the API log to determine if there are any duplicate draw calls, or in the bar chart to determine if there are duplicate passes like an additional depth pass. The tool gameplay programmers will initially use during optimization, however, is the Trace Analyzer tool. Capturing a trace during live analysis opens the door to profiling CPU and GPU utilization. Once open, a trace shows the CPU and GPU queue, frame timings, V-Sync, and process duration. Trace Analyzer is also customizable, allowing a user to change which metrics are collected during capture. By viewing where waits happen, how long an item is in the queue, and how workloads are distributed on the CPU and GPU, gameplay programmers can determine where optimizations are needed (CPU processes versus GPU processes) and where to focus their tuning efforts.
Game Engine Programmers
Finally, we come to the game engine programmers, who create a tool that enables the gameplay programmers to complete their job. The game engine programmers create game-agnostic components that are the foundation on which the gameplay programmers create the game. This can include:
- Implementing how animations will happen
- The physics behind gameplay
- Collision detection
- How pixels will be rendered to the screen
As we touched on in the gameplay programmers section, without dedicated game engine programmers, the gameplay programmers would optimize the shaders. However, with the addition of game engine programmers, shader optimization (vertex, pixel, compute, etc.) falls to the game engine programmers. Using the overdraw view in Frame Analyzer, programmers can identify any Z-test- or depth-test-related optimizations. By entering the overdraw view (Figure 5) for a render target, a programmer can identify whether or not the engine is currently rejecting pixels that will be hidden by closer objects within the scene. If there’s significant overdraw in a scene, it might be useful to further investigate and determine if the depth test is being used within the engine. Adding Z-rejection could limit the number of times an unseen pixel is fully rendered, reducing the total number of draw calls for any given scene. Game engine programmers would also touch any other aspects of the rendering pipeline during optimization, as well as using Trace Analyzer to inspect CPU/GPU utilization and determine any optimizations needed on the CPU, such as optimizing the AI algorithm and physics computations. Game engine programmers can use every aspect of Intel GPA from the GPU pipeline view, which identifies GPU pipeline bottlenecks, to the buffer views.
To learn more on practical optimizations for game engine engineers using Intel GPA, go to Practical Game Performance Analysis Using Intel® Graphics Performance Analyzers (though please note, this article is written using the old UI of Intel GPA), or watch this video.
From Good Game to Great Game
Intel GPA isn’t for just one type of game developer―it offers features for every individual in the game developer team. Hopefully, this brief overview of roles and common pain points associated with the optimization process has made reaching a target framerate more achievable. We’ve only touched the surface in explaining the benefits Intel GPA can provide for each stage of the optimization process, providing some quick items to check for during optimization. To find more ways to optimize your application using Intel GPA, visit software.intel.com/gpa, where you’ll find a Getting Started Guide and a comprehensive help document for each supported operating system.